I have a GCE ubuntu system running ubuntu 20.04 which is now EOL. It has an attached data disk. I'm trying to upgrade to ubuntu 22.04 by doing the following:
clone system by creating a new vm from the old system disk snapshot.
clone a new data disk (data-5) with a different name from the old data disk (data-4).
attach new data disk to new vm
boot new vm
tweak /etc/fstab to mount data disk using new label
perform upgrade on cloned system
The new system boots fine. The new data disk appears to create and attach ok. However, it will not mount:
$ sudo mount LABEL=data-5 /mnt/data
mount: /mnt/data: can't find LABEL=data-5.
lsblk shows the new disk:
$ lsblk | egrep "NAME|sdb"
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 40G 0 disk
If I use the label of the old disk, it appears to mount, but still does not show up:
$ sudo mount LABEL=data-4 /mnt/data/
garya@xblgx-ops-5:~$ sudo ls -l /mnt/data
total 0
garya@xblgx-ops-5:~$ sudo umount /mnt/data
umount: /mnt/data: not mounted.
I did not assign any specific "LABEL" to the data disk when creating it from the snapshot; I did name it "data-5", and that is supposed to be the default label.
What am I doing wrong? Is there something in the ext4 filesystem which is preventing the mount?
There appears to be a label written on the new disk, which is the name from the original disk:
$ sudo e2label /dev/sdb
data-4
Editing the filesystem label to match the disk label solved the problem:
$ sudo e2label /dev/sdb data-5
$ sudo mount LABEL=data-5 /mnt/data