0

I want to check that all other disks except the OS disks are not with partitions by bash script

for example

we can see that sdb is with two internal partitions - sdb1 and sdb2

NAME             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
fd0                2:0    1     4K  0 disk 
sda                8:0    0   150G  0 disk 
├─sda1             8:1    0   500M  0 part /boot
└─sda2             8:2    0 149.5G  0 part 
  ├─vg00-lww_root 253:0    0    40G  0 lvm  /
  ├─vg00-lww_swap 253:1    0   7.7G  0 lvm  [SWAP]
  └─vg00-lww_var  253:2    0 100.9G  0 lvm  /var
sdb                8:16   0    20G  0 disk 
├─sdb1             8:1    0   500M  0 part 
└─sdb2             8:2    0   500M  0 part 
sdc                8:32   0    20G  0 disk 

with which command or syntax we can verify that disk is without partitions as sdc? ( so with this command I will use it in my bash script )

according to our example - sdc disk , is without partitions

  • This question would probably be clearer if you split it into listing the OS disks (which you're already asking about) and the detecting whether the remaining disks are unpartitioned (which could be the core of this question). – n.st Nov 25 '18 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.