FedoraThis forum is for the discussion of the Fedora Project.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
this time I was testing out hard drives by plugging them into my fedora 28 box. I have to admit I was being a bit cavalier, simply connecting the SATA and power cables to the back of the drive and booting without actually placing the drive in a bay. I was powering down before connecting/disconnecting drives.
Anyway the first worked fine. I modified fstab to recognise the UUID, mounted, all good. After I removed this drive and connected another, the PC did not boot. After power up I did not even get the boot screen. I figured I must have broken fstab while changing it.
I booted from a Linux Mint USB and checked the partitions were still in place and fstab looked okay. There was no issue I could see but I restored my backup copy of fstab all the same just to be sure.
I booted again and things looked better. I got the grub menu (I only have fedora installed, no dual boots. 2 fixes drives and one USB drive plugged in permanently), selected the latest kernel and away it went.
However, the boot goes through to the blue fedora icon and that is it. I don't get any further. A trawl around the net suggested I try to ssh in from another PC. Bingo, that worked but I couldn't ssh to my user as there is no /home/tim
Okay, ssh to root works fine. The /home directory is empty but I can mount that partition seperately and all the files are there. I partition my hard drive as an LVM and fstab looks like this:
When in doubt read the messages. From your ssh session "journalctl -b 0" should suffice for the current boot. To see (only) the previous boot use "journalctl -b -1".
Last edited by syg00; 01-06-2019 at 11:23 PM.
Reason: -b 0, and explanded comment.
I connect disks temporarily in same manner as you describe rather frequently. Usually I sit the disk down on a piece of cardboard or DVD sleeve or wood or anti-static sleeve to reduce potential for damage by a bump while in use.
Try to find clues to the /home problem in the journal. If you can't manage this via ssh, try to boot to multi-user: at the Grub menu, strike the e key, cursor down to the kernel line, append a 3, then F10 to boot.
thanks for the useful instructions. I thought I had it sussed but maybe not so. I kept seeing a message where permission was denied when attempting to open /etc/fstab. When I checked the permissions I then saw that fstab was owned by myself and was in my group. This is consistent with the steps I outlined above.
I could not change ownership/group in the current session as the file system is mounted read-only
Quote:
[root@eraserhead ~]# chown root /etc/fstab
chown: changing ownership of '/etc/fstab': Read-only file system
I booted again into the Mint USB, mounted the root filesystem and changed group/ownership. But, still no good
Quote:
Jan 07 18:07:08 eraserhead kernel: audit: type=1400 audit(1546844825.189:46): avc: denied { read } for pid=508 comm="systemd-fstab-g" name="fstab" dev="dm-0" ino=1050389 scontext=system_u:system_r:init_t:s0 tcontext=unconfined_ubject_r:user_home_t:s0 tclass=file permissive=0
Jan 07 18:07:08 eraserhead kernel: audit: type=1300 audit(1546844825.189:46): arch=c000003e syscall=257 success=no exit=-13 a0=ffffff9c a1=5635b6bc95fd a2=80000 a3=0 items=0 ppid=498 pid=508 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="systemd-fstab-g" exe="/usr/lib/systemd/system-generators/systemd-fstab-generator" subj=system_u:system_r:init_t:s0 key=(null)
Jan 07 18:07:08 eraserhead systemd-fstab-generator[508]: Failed to open /etc/fstab: Permission denied
Jan 07 18:07:08 eraserhead systemd[498]: /usr/lib/systemd/system-generators/systemd-fstab-generator failed with exit status 1.
Jan 07 18:07:05 eraserhead audit[508]: AVC avc: denied { read } for pid=508 comm="systemd-fstab-g" name="fstab" dev="dm-0" ino=1050389 scontext=system_u:system_r:init_t:s0 tcontext=unconfined_ubject_r:user_home_t:s0 tclass=file permissive=0
Jan 07 18:07:05 eraserhead audit[508]: SYSCALL arch=c000003e syscall=257 success=no exit=-13 a0=ffffff9c a1=5635b6bc95fd a2=80000 a3=0 items=0 ppid=498 pid=508 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="systemd-fstab-g" exe="/usr/lib/systemd/system-generators/systemd-fstab-generator" subj=system_u:system_r:init_t:s0 key=(null)
Jan 07 18:07:08 eraserhead audit[526]: AVC avc: denied { read } for pid=526 comm="systemd-remount" name="fstab" dev="dm-0" ino=1050389 scontext=system_u:system_r:init_t:s0 tcontext=unconfined_ubject_r:user_home_t:s0 tclass=file permissive=0
Jan 07 18:07:08 eraserhead systemd-remount-fs[526]: Failed to open /etc/fstab: Permission denied
Jan 07 18:07:11 eraserhead audit[609]: AVC avc: denied { read } for pid=609 comm="systemd-remount" name="fstab" dev="dm-0" ino=1050389 scontext=system_u:system_r:init_t:s0 tcontext=unconfined_ubject_r:user_home_t:s0 tclass=file permissive=0
Jan 07 18:07:11 eraserhead systemd-remount-fs[609]: Failed to open /etc/fstab: Permission denied
Jan 07 18:07:11 eraserhead kernel: audit: type=1400 audit(1546844831.137:70): avc: denied { read } for pid=609 comm="systemd-remount" name="fstab" dev="dm-0" ino=1050389 scontext=system_u:system_r:init_t:s0 tcontext=unconfined_ubject_r:user_home_t:s0 tclass=file permissive=0
But I can't see anything wrong with fstab now!
Quote:
-rw-rw-r--. 1 root root 1844 Jan 7 18:06 /etc/fstab
When you paste in logs and such it needs to be in code tags in order for it to be comprehensible. Use the [#] button above the input box, or type in [c0de] and [/c0de] in manually at start and end of the pasted block (spelled correctly of course). If what you wish to paste is large, upload instead, which when successfully booted normally you can do with the Fedora command pastebinit.
It's not clear what you did. When you paste something in, include the cmdline you used to get or create it. Better excess detail than too little.
Fstab probably does not need to be recreated. Paste it in here so we can look at it.
What we need to find out is why anything is being mounted readonly or not at all.
Given the changes you obviously made, it would be a good idea to try, assuming you can get the filesystem into RW mode. If you can, back up the current version, then strip all lines from the one to try, except for:
and see what happens. If it gets you ability to login on a vtty as root, just add back one line at a time until full operation as originally is restored.
I am marking this as solved. I don't know why the problem occurred and I don't know how it was solved but I have learned a lot. Thanks for all the help.
timl's quest helped me, so I thought I'd add a bit to this post.
Fedora 31 (5.4.13-201.fc31.x86_64), windows 10 dualboot, 2 extra ntfs hdds
While trying to debug an unrelated userland problem, I modified /etc/fstab . Nothing crazy, just changed the mount points of some ntfs data partitions from /home/<me>/disks/<stuff> to /mnt/<disknameshere> .
When rebooting, fedora loading screen ran, than hung. None of my grub options would get past the end of loading.
Rebooted to grub, when boot options displayed press e to edit, added 'single' to the end of the linux line to get into single user mode.
Here, I found that root had mounted ro, however swap, boot, and home were not mounted at all. I was able to mount them manually, and even remount root rw, however none of this persisted on boot.
Upon diggint into journalctl, I found a few interesting lines (paraphrased):
systemd-fstab-generator[###]: Failed to open /etc/fstab: Permission denied
systemd-remount-fs[###]: Failed to open /etc/fstab: Permission denied
My (novice) train of thought here went - for some reason, startup doesn't have permission to access fstab.
Permissions were normal, so I figured it must be something to do with root not being mounted when systemd-remount-fs was trying to access /etc/fstab
A million wrong rabbit holes later, followed mrmazda's advice of 'comment out everything except root and boot, add back one at a time'.
This fixed it. No idea how. I made backups of my fstab at different points along the way and I see absolutely zero difference between the original changes that I tried to make, and the current iteration.
The one theory I have is that, between my initial fstab changes and my first reboot, about 30 min passed and I did NOT run systemctl daemon-reload. I'm wondering if some systemd generated unit file might have been incorrectly configured/generated, some-magik-how this prevented partitions from being mounted?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.