[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Will my reconstructed fstab work?



Sorry to hear of your mishap, Ken ...
In regards to possibly making your system un-bootable, I have two suggestions:
1) First make a backup of everything ASAP! (and make plans for frequent regular backups into the future)
2) Always remember that you can boot from the Bullseye install DVD (or USB stick, or whatever) and go into "rescue mode".  From there you can chroot (it's one of the menu options) into the root partition and fix whatever problems you encounter with the fstab.

If you run into problems with either of those, you can always come back to the list with questions.

Good luck! and I hope that helps!
Rick

On Wed, Nov 2, 2022, at 9:52 PM, Ken Heard wrote:
> A few days ago using vim I added to my desktop fstab file a line for a 
> new portable storage device.  in the process I somehow managed to screw 
> up fstab.  Unfortunately I saved the screwed up version of fstab before 
> I noticed the damage done to it.
>
> As I had no fstab backup  -- to correct later -- I had to reconstruct 
> fstab using the information produced by blkid for the missing UUIDs.   I 
> think the reconstruction is correct, but I have since been afraid to 
> close the computer if because of a faulty fstab I would be unable to 
> reopen it
>
> I would consequently appreciate help in verifying  the essential fstab 
> lines, numbered 11-20 in the reconstructed fstab quoted below and 
> thereby assuage my reopening fears.  (Lines 26-40 relating to portable 
> storage devices I checked myself; they all work.)
>
> Basic Information:  two internal hard drives, /dev/sda and /dev/sdb, 
> each divided into two small partitions of equal size.  Sda1 is used for 
> /boot/efi, lines 13 and 15. Partition sdb1, line 17, is currently 
> unused; in time I will copy to it what is in sda1.  Partitions sda2 and 
> sdb2 form a RAID1, with the five LVM partitions listed in lines 11, 18, 
> 19 and 20.  Operating system is Debian Bullseye.
>
> If anybody in interested, following the reconstructed fstab  quoted 
> below is quoted further below how the fsab looked right after the screw 
> up.
>
> 01 # /etc/fstab: static file system information.
> 02 #
> 03 # Use 'blkid' to print the universally unique identifier for a
> 04 # device; this may be used with UUID= as a more robust way to name 
> devices
> 05 # that works even if disks are added and removed. See fstab(5).
> 06 #
> 07 # Systemd generates mount units based on this file, see systemd.mount(5).
> 08 # Please run 'systemctl daemon-reload' after making changes here.
> 09 #
> 10 # <file system> <mount point>   <type>  <options>       <dump>  <pass>
> 11 /dev/mapper/Morcom-ROOT /               ext4    errors=remount-ro 0     1
> 12 # /boot/efi was on /dev/sda1 during installation
> 13 UUID=3020-1029  /boot/efi       vfat    umask=0077      0       1
> 14 # /dos was on /dev/sda1 during installation
> 15 UUID=3020-1029  /dos            vfat    utf8            0       0
> 16 # /dos2 was on /dev/sdb1 during installation
> 17 UUID=2AF2-0A16  /dos2           vfat    utf8            0       0
> 18 /dev/mapper/Morcom-HOME_crypt /home           ext4    defaults 0       2
> 19 /dev/mapper/Morcom-VAR /var            ext4    defaults        0       2
> 20 /dev/mapper/Morcom-SWAP_crypt none            swap    swap	 0       0
> 21 /dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
> 22 tmpfs	/tmp	tmpfs	nodev,nosuid,size=20%	0	0
> 23 UUID=c5444477-7f18-4443-a77b-c5827f977449 /media/fdr ext2 
> user,noauto,noatime 0	 0
> 24 UUID=33cebfb3-b568-493f-853b-e1b7ca5cc3a2 /media/fde ext2 
> user,noauto,noatime  0 0
> 25 # -e8b57fb2ac09/media/ssda	ext4	user,npauto,noatime		0	0
> 26 UUID=la449167-8497-4471-ae0c-e8b57fb2ac09 /media/phda ext4 
> user,noauto,noatime 0 0
> 27 UUID=0fee2d01-2441-4699-a4ae-bb45c417b8ee /media/ssda ext4 
> user,noauto,noatime 0 0
> 28 UUID=e26255ab-e6c5-4bcd-941c-7378b7cf4083 /media/ssdb ext4 
> user,noauto,noatime 0 0
> 29 UUID=3DB1-1700	/media/fdg	vfat	user,noauto,noatime		0	0
> 30 UUID=5966-5502	/media/fdp	vfat	user,noauto,noatime		0	0
> 31 UUID=1170-1657	/media/hca	vfat	user,noauto,noatime		0	0
> 32 UUID=0E0A-0F26	/media/hcb	vfat	user,noauto,noatime		0	0
> 33 UUID=1E82-122E	/media/hcc	vfat	user,noauto,noatime		0	0
> 34 UUID=1D1F-1032 	 /media/xca	exfat	user,noauto,noatime		0	0
> 35 UUID=1909-1458	/media.xcb	exfat	user,noauto,noatime		0	0
> 36 UUID=6238-3434	/media/xcc	exfat	user,noauto,noatime		0	0
> 37 UUID=206F-163F	/media/xcd	exfat	user,noauto,noatime		0	0
> 38 UUID=3630-6530	/media/xce	exfat	user,noauto,noatime		0	0
> 39 UUID=3065-6630	/media/xcf	exfat	user,noauto,noatime		0	0
> 40 LABEL=ostree		/media/phdc	ext4	user,noauto,noatime		0	0
>
> Right after the screw up the fstab looked like this.
>
> 01 -e8b57fb2ac09static file system information.
> 02 -e8b57fb2ac09
> 03 -e8b57fb2ac09lkid' to print the universally unique identifier for a
> 04 -e8b57fb2ac09vice; this may be used with UUID= as a more robust way 
> to name devices
> 05 -e8b57fb2ac09at works even if disks are added and removed. See fstab(5).
> 06-e8b57fb2ac09
> 07 -e8b57fb2ac09d generates mount units based on this file, see 
> systemd.mount(5).
> 08 -e8b57fb2ac09n 'systemctl daemon-reload' after making changes here.
> 09 -e8b57fb2ac09
> 10 -e8b57fb2ac09ile system> <mount point>   <type>  <options> <dump>  <pass>
> 11 -e8b57fb2ac09ev/mapper/Morcom-ROOT /               ext4 
> errors=remount-ro 0       1
> 12 -e8b57fb2ac09fi was on /dev/sda1 during installation
> 13 -e8b57fb2ac09020-1029  /boot/efi       vfat    umask=0077      0       1
> 14-e8b57fb2ac09ot was on /dev/sda1 during installation
> 15 -e8b57fb2ac09020-1029  /dos            vfat    utf8            0       0
> 16 -e8b57fb2ac09os2 was on /dev/sdb1 during installation
> 17-e8b57fb2ac09AF2-0A16  /dos2           vfat    utf8            0       0
> 18 -e8b57fb2ac09mapper/Morcom-HOME_crypt /home           ext4 defaults 
>     0       2
> 19 -e8b57fb2ac09mapper/Morcom-VAR /var            ext4    defaults  0    2
> 20 -e8b57fb2ac09mapper/Morcom-SWAP_crypt none            swap    swap	 0 
>        0
> 21 -e8b57fb2ac09r0	/media/cdrom0   udf,iso9660 user,noauto     0       0
> 22 -e8b57fb2ac09tmpfs	nodev,nosuid,size=20%	0	0
> 23 -e8b57fb2ac0944477-7f18-4443-a77b-c5827f977449 /media/fdr ext2 		 
> user,noauto,noatime 0	0
> 24 -e8b57fb2ac09cebfb3-b568-493f-853b-e1b7ca5cc3a2 /media/fde ext2 
> user,noauto,noatime 0 0
> 25 -e8b57fb2ac09/media/ssda ext4 user,noauto,noatime 0 0
> 26 -e8b57fb2ac099167-8497-4471-ae0c-e8b57fb2ac09 /media/phda ext4 
> user,noauto,noatime 0 0
> 27 UUID=0fee2d01-2441-4699-a4ae-bb45c417b8ee /media/ssda ext4 
> user,noauto,noatime 0 0
> 28 UUID=e26255ab-e6c5-4bcd-941c-7378b7cf4083 /media/ssdb ext4 
> user,noauto,noatime 0 0
> 29 UUID=3DB1-1700	/media/fdg	vfat	user,noauto,noatime	0	0
> 30 UUID=5966-5502	/media/fdp	vfat	user,noauto,noatime	0	0
> 31 UUID=1170-1657	/media/hca	vfat	user,noauto,noatime	0	0
> 32 UUID=0E0A-0F26	/media/hcb	vfat	user,noauto,noatime	0	0
> 33 UUID=1E82-122E	/media/hcc	vfat	user,noauto,noatime	0	0
> 34 UUID=1D1F-1032  /media/xca	exfat	user,noauto,noatime	0	0
> 35 UUID=1909-1458	/media.xcb	exfat	user,noauto,noatime	0	0
> 36 UUID=6238-3434	/media.xcc exfat	usr,noauto,nonatime	0	0
> 37 UUID=206F-163F	/media/xcd	exfat	user,noauto,noatime	0	0
> 38 UUID=3630-6530	/media/xce	exfat	user,noauto,noatime	0	0
> 39 UUID=3065-6630	/media/xcf	exfat	user,noauto,noatime	0	0
> 40 LABEL=ostree	/media/phdc	ext4	user,noauto,noatime	0	0
>
> The screw up started a few days ago when I entered into the file a new 
> portable storage device, line 26 above.  That entry itself was 
> successful.  In addition however the beginning of the text of all lines 
> 1-26 was overwritten by -e8b57fb2ac09, which happens to be the last 12 
> digits, plus the preceding hyphen, of the UUID of the added storage 
> device on line 26.  Lines 27-40 were spared the overwrites.  I have no 
> idea how these overwrites happened; it certainly was not the result of 
> any conscious action on my part.
>
> Regards, Ken Heard


Reply to: