OS : Oracle Linux 6.8 (UEK)
In my Oracle Linux server (actually OVM) I have more than 30 SAN LUNs attached. When I run fdisk i can see lot of LUNs like below.
But, I just need to see those LUNs who are not partitioned. As you can see in the below fdisk output, /dev/xvdf and /dev/xvdg LUNs (in red) are not partitioned. Since this server has relatively less number of LUNs attached to it , I can manually go through the fdisk output.
But, in my physical servers , where large DBs are running in ASM , there are 100+ SAN LUNs attached (Hitachi VSP , EMC VMAX ) to server and it is difficult to go through the entire fdisk output.
So, I would like to know if there is a linux command which would show LUNs which are not partitioned.I recently discovered that there were few 250 GB LUNs lying around unused in few our RAC DB servers. I need to find LUNs like these so that I could partition these unused LUNs and add to the ASM diskgroup. Even a clever grep of fdisk output will do
Note: The LUN names are of the format /dev/xvd... as this is an OVM. For EMC LUNs , they are /dev/emcpowerpatha, /dev/emcpowerpathb, ..
# fdisk -l
Disk /dev/xvdc: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/xvdc1 1 2611 20971519+ ee GPT
WARNING: GPT (GUID Partition Table) detected on '/dev/xvdd'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/xvdd: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/xvdd1 1 2611 20971519+ ee GPT
WARNING: GPT (GUID Partition Table) detected on '/dev/xvde'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/xvde: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/xvde1 1 2611 20971519+ ee GPT
Disk /dev/xvdf: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/xvdg: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/osvg-LogVol08: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
<snipped output>