Score:0

Broken fstab, lvm root file system ubuntu (22.04) urgent help pls - possibly solved but verify pls

gm flag

I was adding some nfs links to fstab but a stray process filled disk so I lost fstab when trying to save. Am trying to recreate, machine is still live.

Found some helpful links, used blkid and think I have put mount for boot device.

However the main system is on lvm and the UUID for that doesn't seem to match the underlying block devices.

I tried looking at fstab and blkid on another machine and copied fstab (called 360g72.71) which works.

I couldn't figure out how the UUID for the lvm is created from blkid or how else to find it. Edit - I found in /etc/lvm/backup a file which contained that id and have edited this into fstab, basically I concatenated the vg identifier and the ubuntu volume id and removed the '-' in between.

Here is my current fstab with comments showing where I have got to, I think I have solved it but appreciate comments before I try it!

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#

#copied from 360g72.71
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/ubuntu-vg/ubuntu-lv during curtin installation
#/dev/disk/by-id/dm-uuid-LVM-g6G2lkUVsE4qegAqsM1UZGb0i88snEbkffPzeOywoh0vzv6Pc3fAySNjDiVa6ztb / ext4 defaults 0 1

#lvm from 360g72
#ubuntu-vg {
#        id = "g6G2lk-UVsE-4qeg-AqsM-1UZG-b0i8-8snEbk"

#                pv0 {
#                        id = "dwf5SW-xDsZ-aRM7-0K6z-iy2a-5PkR-0X0CMR"
#                        device = "/dev/sda3"    # Hint only

#                        id = "ffPzeO-ywoh-0vzv-6Pc3-fAyS-NjDi-Va6ztb"

#new

#lvm extracts from here /etc/lvm/backup
#vg
#7FHuF7-Wdbd-WZQV-Qrfg-0rZI-MIWN-ux3Scj
#ubuntu
#ENY1Z6-l9ti-zdHj-hjXd-PE1M-PzeQ-YhA4ez
/dev/disk/by-id/dm-uuid-LVM-7FHuF7WdbdWZQVQrfg0rZIMIWNux3ScjENY1Z6l9tizdHjhjXdPE1MPzeQYhA4ez / ext4 defaults 0 1



#blkid from 360g72.71
#/dev/mapper/ubuntu--vg-ubuntu--lv: UUID="045b0ff5-18a4-43f7-906c-e22c53a8b08a" BLOCK_SIZE="4096" TYPE="ext4"
#UUID="kaGiOI-TF2O-GbBt-B1zS-EHRO-IifV-brUmJW": UUID="QuFATb-PqON-3HDt-LdrU-LdGg-uPCA-D7cVKQ" TYPE="LVM2_member"

#UUID="0a166d03-2dae-42b6-b877-6616d3fcd9ff" BLOCK_SIZE="4096": UUID="f1501104-970c-49e8-9e4b-f903dedbf018" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="aa65834e-ec0c-44d0-aae5-7caf363d04dc"

#UUID="pm2Yk5-jfUs-klJj-xwl2-PSbO-XYY3-fiFEmD": UUID="dwf5SW-xDsZ-aRM7-0K6z-iy2a-5PkR-0X0CMR" TYPE="LVM2_member" PARTUUID="4242fec0-5a25-44a8-8e39-0cd9ba9b9c1f"


# /boot was on UUID="0a166d03-2dae-42b6-b877-6616d3fcd9ff" BLOCK_SIZE="4096" during curtin installation


#from 360g72
#/dev/disk/by-uuid/f1501104-970c-49e8-9e4b-f903dedbf018 /boot ext4 defaults 0 1
#

#new
#this blkid output
#/dev/mapper/ubuntu--vg-ubuntu--lv: UUID="4ed86e70-199c-41e8-918d-e200f7e08a63" BLOCK_SIZE="4096" TYPE="ext4"
#UUID="kaGiOI-TF2O-GbBt-B1zS-EHRO-IifV-brUmJW": UUID="kaGiOI-TF2O-GbBt-B1zS-EHRO-IifV-brUmJW" TYPE="LVM2_member"

#UUID="0a166d03-2dae-42b6-b877-6616d3fcd9ff" BLOCK_SIZE="4096": UUID="0a166d03-2dae-42b6-b877-6616d3fcd9ff" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="6b874856-8811-4dce-b578-a8303d6bdfc3"

#UUID="pm2Yk5-jfUs-klJj-xwl2-PSbO-XYY3-fiFEmD": UUID="pm2Yk5-jfUs-klJj-xwl2-PSbO-XYY3-fiFEmD" TYPE="LVM2_member" PARTUUID="8cedc84d-8808-42fb-b1ff-9579c6fd5c77"
#/dev/sda1: PARTUUID="c4569521-c7a0-4b61-8dd8-65dd2c0f8de1"

/dev/disk/by-uuid/0a166d03-2dae-42b6-b877-6616d3fcd9ff  /boot ext4 defaults 0 1
#

/swap.img       none    swap    sw      0       0
ipsodell310:/nfs/10T /nfs/10T nfs defaults 0 0
ipsodell310:/nfs/4T /nfs/4T nfs defaults 0 0
truenas:/mnt/Hp40 /nfs/40T nfs defaults 0 0
Nikita Kipriyanov avatar
za flag
Please, post your `/proc/mounts` (that could be a good hint for re-creating the fstab), also raw `blkid` and `lsblk`. E.g. we need that information as your system shows it, not as you interpret it.
Ginnungagap avatar
gu flag
`/etc/mtab` is also a good *starting point* for recreating a live system's `/etc/fstab`.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.