0

I've got the following drives on my server

NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0    7:0    0 86.6M  1 loop /snap/core/4571
loop1    7:1    0 86.6M  1 loop /snap/core/4486
sda      8:0    0   16G  0 disk
├─sda1   8:1    0    1M  0 part
└─sda2   8:2    0   16G  0 part /
sdb      8:16   0  1.7T  0 disk
└─sdb1   8:17   0  1.7T  0 part
sdc      8:32   0  1.7T  0 disk

I want to automount sdb and sdc each time the machine boots so went to edit fstab. I thought VMTools took care of this for me when using esxi though? It's running...

 ps -e | grep ".vm."
  284 ?        00:00:00 irq/16-vmwgfx
  480 ?        00:00:02 vmtoolsd
  486 ?        00:00:00 lvmetad

but when editing fstab there's only 2 lines

UUID=a8471d76-5173-11e8-9ea2-000c293859e1 / ext4 defaults 0 0
/swap.img       none    swap    sw      0       0

Can I just add something like this without bricking my VM?

/dev/sdb1    /myfolder/to/mount   ext4    defaults    0    1

Or is there something else i need to do? It's Ubuntu by the way, 18.04LTS 64bit. The hard drives are added in esxi & linked to vmware datastores

Syntax Error
  • 155
  • 1
  • 10

1 Answers1

0

Use the command:

blkid

That will give you the UUID and filesystem for each partition (or logical volume if you are using them). The filesystem will be listed as TYPE=ext4 or whatever the filesystem may be.

If you want to mount it by UUID then just substitue it for /dev/sdb1 in fstab so that it looks like this:

UUID=the-uuid-for-dev-sdb1 /myfolder/to/mount ext4 defaults 0 0

Obviously, you'd replace the above UUID part for the actual UUID of /dev/sdb1. Also, make sure that the filesystem type is correct by seeing that it matches with TYPE in the output of blkid.

Nasir Riley
  • 2,035
  • 8
  • 9