Google Why Mount /dev/root AND /dev/sda1 on / in Ubuntu 18.04 LTS Minimal Image

google-cloud-platformgoogle-compute-enginemountubuntu-18.04

Google is mounting two different disks on / in Ubuntu 18.04 LTS Minimal image. This uglifies VM monitoring since the disk labels are inconsistent from machine to machine depending on what type of Ubuntu image is used.

Normal Ubuntu 18.04 LTS image does NOT have this problem. /dev/sda1 shows up correctly as the ONLY disk mounted on /

BUT, on minimal image Ubuntu 18.04 LTS, Google is doing something wrong with the disks. It is mounting two different disks on the same mount path. /dev/root and /dev/sda1 are both mounted on /

df shows /dev/root mounted on /

Filesystem     1K-blocks   Used Available Use% Mounted on  
/dev/root        9983232 829708   9137140   9% /  
devtmpfs         1888736      0   1888736   0% /dev  
tmpfs            1890960      0   1890960   0% /dev/shm  
tmpfs            1890960    856   1890104   1% /run  
tmpfs               5120      0      5120   0% /run/lock  
tmpfs            1890960      0   1890960   0% /sys/fs/cgroup  
/dev/sda15        106858   3682    103177   4% /boot/efi  
/dev/loop0         90880  90880         0 100% /snap/core/7396  
/dev/loop1         67200  67200         0 100% /snap/google-cloud-sdk/99  
tmpfs             378192      0    378192   0% /run/user/1001  

lsblk shows sda1 is ALSO mounted on /

NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT  
loop0     7:0    0 88.7M  1 loop /snap/core/7396  
loop1     7:1    0 65.6M  1 loop /snap/google-cloud-sdk/99  
sda       8:0    0   10G  0 disk   
├─sda1    8:1    0  9.9G  0 part  /  
├─sda14   8:14   0    4M  0 part   
└─sda15   8:15   0  106M  0 part /boot/efi    

more info: df /dev/sda1 gives the wrong result:

Filesystem     1K-blocks  Used Available Use% Mounted on  
devtmpfs         1888736     0   1888736   0% /dev  

I'd like to use /dev/sda1 as the disk because that's what all other Ubuntu images do on GCP. The minimal Ubuntu images are REALLY fast to boot up so it would s** to have to go back to full Ubuntu image.

Best Answer

/dev/root is not a device. It is a symbolic link to the device mounted as root.

Your system does not have a problem with mounting two disks as /.

readlink -f /dev/root will display the real device mounted as /, which will usually be /dev/sda1.

Related Topic