Topic Linux File System - Episode Question about fstab and locked root account
-
Hi all,
i am learning about the CompTia Linux+ Exam and currently watching the ITPRO TV episodes about it.
On the episode Linux File System, we are editing the /etc/fstab file that on boot the partition is automatically mounted.
I think i did it right but it seems not, because on system reboot, the boot fails and root account is locked, and i cant do anything anymore :) God bless virtual machines gg
But i would like too know, why it fails what did i wrong ? Below some informations about the config
sudo blkid
/dev/sdb1: UUID="BEsqa1-YvRo-pNcS-7MLz-wq2b-YWRO-Muazey" TYPE="LVM2_member" PARTUUID="e3799687-01"
/dev/sdc1: UUID="whr93e-A0yF-LUH3-deNi-HyGy-zdhz-uLBRim" TYPE="LVM2_member" PARTUUID="c715a0f1-01"
/dev/sda1: UUID="d1fa2eb5-318c-4a1f-879a-f230abf45cd3" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="42136559-01"
/dev/sda5: UUID="76a2be20-235e-4abe-b906-35256de7e1e0" TYPE="swap" PARTUUID="42136559-05"
/dev/sdd1: PARTUUID="6ee9aa89-01"
/dev/mapper/datavg1-lv1: UUID="afc2d8c0-23e2-4de4-b894-faddf17a92f7" BLOCK_SIZE="1024" TYPE="ext4"View current working fstab file - less /etc/fstab
<file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda1 during installation UUID=d1fa2eb5-318c-4a1f-879a-f230abf45cd3 / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=76a2be20-235e-4abe-b906-35256de7e1e0 none swap sw 0 0 /dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
And i get the same error when i add the device with the /dev/mapper/datavg1-lv1 or the UUID of the devie
After editing below , boot is not possible and root account is locked
# <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda1 during installation UUID=d1fa2eb5-318c-4a1f-879a-f230abf45cd3 / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=76a2be20-235e-4abe-b906-35256de7e1e0 none swap sw 0 0 /dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0 UUID=afc2d8c0-23e2-4de4-b894-faddf17a92f7 /mnt/storage ext4 defaults 0 0
# <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda1 during installation UUID=d1fa2eb5-318c-4a1f-879a-f230abf45cd3 / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=76a2be20-235e-4abe-b906-35256de7e1e0 none swap sw 0 0 /dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0 /dev/mapper/datavg1-lv1 /mnt/storage ext4 defaults 0 0
Any suggestion why the boot fails after that edit to fstab ? :)
-
There is likely an issue with mounting the volume that is stopping you from booting properly. The fstab file does not gracefully handle errors. If anything goes wrong, the boot process basically halts. Have you tried testing your changes prior to rebooting? If not, try the following:
- Modify
/etc/fstab
as desired. - Execute
sudo mount -a
to test the fstab. That will cause the system re-read the configuration and attempt to mount all file systems listed. - Check to see if the volume mounted properly and that you can read/write to it as expected.
- If it fails to mount, use
sudo dmesg | grep '[Mm]ount'
to find out why.
In my experience, the usual suspect is file permissions. When mounting a volume manually, it happens as your user or as root (if you used sudo). When booting, it is performed by the init system. You may need to relax the permissions on
/mnt/storage
to allow init to mount to it. - Modify
-
Thanks for the fast reply ! It sounds strange, but i did it again same as printed above , checked your steps and it mounted properly if i did the sudo mount -a . I rebootet and it bootet properly, but i did nothing different than before .
Maybe a weird coincidence, because i did it with a virtual box linux machine ?
However it works exact like you said now :)
Have a nice Day !