LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - Installation (https://www.linuxquestions.org/questions/slackware-installation-40/)
-   -   mount: can't find /mnt in /etc/fstab (https://www.linuxquestions.org/questions/slackware-installation-40/mount-cant-find-mnt-in-etc-fstab-4175606919/)

rbn14 05-29-2017 06:20 PM

mount: can't find /mnt in /etc/fstab
 
I have 14.2 with root on BTRFS with the generic kernel and grub as a virtual guest on KVM. During boot it get:
Code:

mount: can't find /mnt in /etc/fstab
I'm thinking it has something to do with the initrd but I'm not sure.

Keruskerfuerst 05-30-2017 09:07 AM

Can you post /etc/fstab?

BW-userx 05-30-2017 11:00 AM

maybe it - it seeing something that is calling for it to be mounted on /mnt but it is not within the fstab file so it fails to mount then is giving you that message.

rbn14 05-30-2017 10:21 PM

Quote:

Originally Posted by Keruskerfuerst (Post 5716963)
Can you post /etc/fstab?

I definitely can but I know I am not trying to mount anything on /mnt myself. Does initrd mount the filesystem to /mnt and the chroot it?

Didier Spaier 05-31-2017 01:29 AM

Quote:

Originally Posted by rbn14 (Post 5717219)
Does initrd mount the filesystem to /mnt and the chroot it?

If you speak about the installer, the initrd does mount / (of the target system) as /mnt but it doesn't need /etc/fstab as it does that on behalf of root, so there is no need for /etc/fstab. But that should not be your context anyway, as the installer ships only a huge kernel, so I assume that you already installed 14.2 and try to boot it, and that you built the initrd that loads the needed drivers beyond what's buit in the generic kernel. Is that right?

Even in that case I do not understand that message, as I don't see a reason to mount /mnt in the startup process, and if it was the case it would be done as root anyway so you shouldn't get that message, only displayed in case or a non root user.

Elaborating on your context and situation could help understand your issue. I don't understand what you mean with "grub as a virtual guest on KVM", as your Slackware could be a virtual guest, not the boot manager. At the very least we need more information like your grub.cfg and your KVM setting, and the command used to built the initrd.

BW-userx 05-31-2017 07:39 AM

and a peek at your fstab as well. all of the information is helpful and only takes a moment to cat -> select -> copy -> paste -> post (in code tabs)

bassmadrigal 05-31-2017 05:01 PM

Quote:

Originally Posted by Didier Spaier (Post 5717262)
Even in that case I do not understand that message, as I don't see a reason to mount /mnt in the startup process, and if it was the case it would be done as root anyway so you shouldn't get that message, only displayed in case or a non root user.

Just a stab in the dark, because I'm not all that familiar with the initrd process beyond running mkinitrd_command_generator.sh, but if someone were to build an initrd from the installer without using a chroot (if it's even possible), could that lead to the initrd trying to mimic the same conditions (ie, having the root partition mounted to /mnt/)?

rbn14 06-01-2017 10:48 AM

Quote:

Originally Posted by Didier Spaier (Post 5717262)
.... I assume that you already installed 14.2 and try to boot it, and that you built the initrd that loads the needed drivers beyond what's buit in the generic kernel. Is that right?

That is correct.
Quote:

Originally Posted by Didier Spaier (Post 5717262)
Elaborating on your context and situation could help understand your issue. I don't understand what you mean with "grub as a virtual guest on KVM", as your Slackware could be a virtual guest, not the boot manager. At the very least we need more information like your grub.cfg and your KVM setting, and the command used to built the initrd.

I can see how that sounds confusing. I was just trying to explain the setup, which is non-typical as slackware is installed on a kvm virtual guest and I have installed the grub boot loader rather than the default lilo.

I can post the grub.cfg tonight. Initrd was built using:
Code:

mkinitrd -c -k 4.4.14 -f btrfs -r /dev/sda1 -m btrfs -u -o /boot/initrd.gz
Then the init script was patched to fix the error where it ignores the rootflags parameter and then initrd was generated again using:
Code:

mkinitrd -k 4.4.14 -f btrfs -r /dev/sda1 -m btrfs -u -o /boot/initrd.gz

rbn14 06-02-2017 12:13 AM

So a few more things.
I recognized the line following the mount error from the init script.
Code:

mount: can't find /mnt in /etc/fstab
ERROR: No /sbin/init found on rootdev (or not mounted). Trouble ahead.
      You can try to fix it. Type 'exit' when things are done.

From the init script:
Code:

mount -o ro,$ROOTFLAGS -t $ROOTFS $ROOTDEV /mnt

if [ ! -r /mnt/sbin/init ]; then
  echo "ERROR: No /sbin/init found on rootdev (or not mounted). Trouble ahead."
  echo "You can try to fix it. Type 'exit' when things are done."

So I mounted the filesystem manually and exited
Code:

mount -o ro,subvol=system -t btrfs /dev/sda1 /mnt
exit

and the system continued to boot up fine. I thought maybe I screwed up when I patched the init script to use the rootflags boot option so I hardcoded that into the init script
Code:

mount -o re,subvol=system -t $ROOTFS $ROOTDEV /mnt
rebuilt the initrd, and rebooted. The issue was still there so I went back in and hard coded the entire mount line in the script
Code:

mount -o ro,subvol=system -t btrfs /dev/sda1 /mnt
rebuilt, and rebooted. All booted up fine?! I checked the contents of rootfs and rootdev in /boot/initrd-tree/ and they had all the correct info.

hulahoop 07-31-2017 06:39 AM

newbie, same problem.

new install 14.2 with btrfs and grub, boots ok.

upgrade to current, still boots ok.

change to generic kernel, won't boot. have to
mount /dev/sda1 /mnt
then exit
to continue booting.

had to follow rbn14's tip
hardcoded into init script
mount -o ro -t btrfs /dev/sda1 /mnt

BW-userx 07-31-2017 08:42 AM

Quote:

Originally Posted by hulahoop (Post 5742070)
newbie, same problem.

new install 14.2 with btrfs and grub, boots ok.

upgrade to current, still boots ok.

change to generic kernel, won't boot. have to
mount /dev/sda1 /mnt
then exit
to continue booting.

had to follow rbn14's tip
hardcoded into init script
mount -o ro -t btrfs /dev/sda1 /mnt

I DO NO THINK Piggy backing is allowed in here. you might want to create your own post for your own problem. 2) include detailed steps you took to swap kernels - including output from same steps - links you might have created too match the new kernel to the fileName that lilo or grub looks at to use to boot.


All times are GMT -5. The time now is 05:52 AM.