I have ran this command to see what disks there are:
sudo lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
And the result is:
sda 1:0:1:0 680G
└─sda1 680G /mnt
sdb 3:0:0:0 1T
sdc 0:0:0:0 512G
├─sdc1 511.9G /
├─sdc14 4M
└─sdc15 106M /boot/efi
From this, I can see that sdb is the one I want. I will then create a partition on that one, but first I need to get it's name into a variable so I can use in the next step.
As I've deployed this VM, it seems like not always sdb is the one I need, some times it's sda, so I want to have a way to automate this.
Is there any script that helps me?
Thank you
sudo blkid
. You'll encounter some UUIDs. You can use them to specify a disk:udev
creates symlinks of the form/dev/disk/by-uuid/<UUID>
, those link to actual devices. Also if you want to access them by the path (controller, device id on that controller and so on), you can use symlinks in/dev/disk/by-path/
. Now I feel you've got where to explore.