LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-27-2020, 04:25 PM   #1
zdolar
Member
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 177

Rep: Reputation: 38
slackware-current install on USB - .. can't find /mnt in /etc/fstab


slackware64-current (16. 3. 2020)
install on USB disk

As kernel do not have compiled in USB devices, I created initrd.
Suggested by mkinitrd_command_generator.sh do not include USB modules:

Code:
mkinitrd -c -k 5.4.25 -f ext4 -r "UUID=202a8463-30c8-4806-8631-02a54da3090b" -m usb-storage:xhci-hcd:jbd2:mbcache:crc32c_intel:crc32c_generic:ext4 -u -o /boot/initrd.gz
Also at boot time created initrd from above code returned
Quote:
errors:
jbd2: exports duplicate symbol jbd2_journal_restart (owned ky kernel)
modprobe ERROR: could not insert 'jbd2+: exec format error
The same error was with ext4 and mbcache modules.

So I created own code, I used years ago:
Code:
mkinitrd -c -k 5.4.25 -f ext4 -r UUID=202a8463-30c8-4806-8631-02a54da3090b -m usb-storage:xhci-hcd:xhci-pci:ohci-pci:ehci-pci:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd2:mbcache:crc32c_intel:crc32c_generic:ext4 -u -o /boot/initrd.gz
As you can see, a root device is named by UUID.
/etc/fstab line for mount root partition:
Code:
PARTUUID=fe50e8fe-01        /                ext4        defaults         1   1
The lilo.conf general par do not include boot= instead there is:
Code:
append=" root=PARTUUID=fe50e8fe-01 "
The boot partition part is:
Code:
image = /boot/vmlinuz
  initrd=/boot/initrd.gz
#  root = /dev/sdc1
  label = Slackware
  read-only  # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
The above settings worked with slackware64-current install two years ago.

Now at boot from USB disk ends with:
Quote:
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.
Found a workaround on that forum:
Code:
mount -o ro -t ext4 /dev/sda1 /mnt
exit
After that, boot continues and finishes without error.
All works including KDE.

Have tried many versions in fstab and lilo.conf - naming of boot partition by PARTUUID, by /dev/sdXX. None works.

How to permanently solve that problem?
 
Old 03-27-2020, 05:42 PM   #2
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 928

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
booting from usb maybe it is useful to add -w 5 option,
it will wait for five seconds to usb devices be ready.

Also my modules line is a little bit different,
but I think jbd2 and mbcache aren't needed, with ext4 on the list
they will be added automatically.
 
Old 03-28-2020, 03:54 AM   #3
zdolar
Member
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 177

Original Poster
Rep: Reputation: 38
Thanks.

Not sure will help, but where to put -w 5 option? Lilo?
Please post exact line and in which script.
Regarding modules in a mkinitrd:
/boot/initrd-tree/modules.dep:
Code:
kernel/fs/ext4/ext4.ko: kernel/fs/mbcache.ko kernel/fs/jbd2/jbd2.ko
The other question. Why do I must include ext4 module in a initrd? Look in a compiled kernel .config is a line:
Code:
CONFIG_EXT4_FS=y
- compiled in kernel.
So default Slackware huge kernel have built in ext4 AND also module (found in a installed /lib/modules)
 
Old 03-28-2020, 06:07 AM   #4
_peter
Member
 
Registered: Sep 2014
Location: paris
Distribution: slackware
Posts: 314

Rep: Reputation: Disabled
https://docs.slackware.com/howtos:sl...sistent_naming
hi,
to build the initrd.gz you use
Code:
UUID=202a8463-30c8-4806-8631-02a54da3090b
and in lilo you use
Code:
append=" root=PARTUUID=fe50e8fe-01 "
it worked for you before that way i guess ? using UUID at my end for lilo/fstab/mkinitrd.
 
Old 03-28-2020, 06:21 AM   #5
zdolar
Member
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 177

Original Poster
Rep: Reputation: 38
Quote:
Originally Posted by _peter View Post
https://docs.slackware.com/howtos:sl...sistent_naming
hi,
to build the initrd.gz you use
Code:
UUID=202a8463-30c8-4806-8631-02a54da3090b
and in lilo you use
Code:
append=" root=PARTUUID=fe50e8fe-01 "
it worked for you before that way i guess ? using UUID at my end for lilo/fstab/mkinitrd.
The above is all already used in my scripts. The boot continues after manually mount when stop before initrd. Read my first post please.
 
Old 03-28-2020, 06:27 AM   #6
_peter
Member
 
Registered: Sep 2014
Location: paris
Distribution: slackware
Posts: 314

Rep: Reputation: Disabled
sorry, i meant use UUID instead of PARTUUID in your lilo configuration

Last edited by _peter; 03-28-2020 at 06:30 AM. Reason: uuid
 
Old 03-28-2020, 06:31 AM   #7
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,056

Rep: Reputation: Disabled
I don't think that lilo.conf accepts a naming by PARTUUID (partition's UUID). Try with UUID (file system's UUID) instead.

Also, what says "lilo -t"?

Last edited by Didier Spaier; 03-28-2020 at 06:32 AM.
 
Old 03-28-2020, 06:34 AM   #8
zdolar
Member
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 177

Original Poster
Rep: Reputation: 38
Quote:
Originally Posted by _peter View Post
sorry, i meant use UUID instead of PARTUUID in your lilo configuration
That worked 2 years ago.
An what else can I use to define USB disk by ID instead of /dev/SDXX. In append parameter of lilo.config?
 
Old 03-28-2020, 07:01 AM   #9
_peter
Member
 
Registered: Sep 2014
Location: paris
Distribution: slackware
Posts: 314

Rep: Reputation: Disabled
the below should give you a list of the connected drives UUID - including usb -
Code:
ls -la /dev/disk/by*
use didier recommendation as well on the -t option while executing lilo.

this is the UUID syntax for your lilo.conf
Code:
   root=<root-device>
              This specifies the device that should be mounted as root.  It may be specified  as  a
              global  option.   If  the special name current is used, the root device is set to the
              device on which the root file system is currently  mounted.  If  the  root  has  been
              changed  with  -r , the respective device is used. If the variable `root' is omitted,
              the root device setting contained in the running kernel image is used.  Warning: This
              can induce to an unbootable system!

              The  root  filesystem  may  also  be  specified by a LABEL= or UUID= directive, as in
              '/etc/fstab'.  In this case, the argument to root=  must  be  enclosed  in  quotation
              marks, to avoid a syntax error on the second equal sign, e.g.:

                   root="LABEL=MyDisk"
                   root="UUID=5472fd8e-9089-4256-bcaa-ceab4f01a439"

              Note:    The   command   line   root=   parameter  passed  to  the  kernel  will  be:
              'root=LABEL=MyDisk'; i.e., without the quotation marks. If  the  root=  parameter  is
              passed  from  the  boot  time  boot: prompt, no quotes are used.  The quotes are only
              there to satisfy the requirements of the boot-installer parser, which treats an equal
              sign  as  an operator.  The kernel command line parser is very much simpler, and must
              not see any quotation marks.  Simply stated, only  use  the  quotation  marks  within
              /etc/lilo.conf.
this thread from 2018 is clear, especially posts #4 & #7 by one of the wiki's author

Last edited by _peter; 03-28-2020 at 07:31 AM. Reason: thread to read
 
Old 03-28-2020, 08:17 AM   #10
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 928

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
Quote:
Originally Posted by zdolar View Post
Thanks.

Not sure will help, but where to put -w 5 option? Lilo?
Please post exact line and in which script.
Regarding modules in a mkinitrd:
/boot/initrd-tree/modules.dep:
Code:
kernel/fs/ext4/ext4.ko: kernel/fs/mbcache.ko kernel/fs/jbd2/jbd2.ko
The other question. Why do I must include ext4 module in a initrd? Look in a compiled kernel .config is a line:
Code:
CONFIG_EXT4_FS=y
- compiled in kernel.
So default Slackware huge kernel have built in ext4 AND also module (found in a installed /lib/modules)
Excuse me, I really wasn't clear. -w options is for mkinitrd.
Code:
mkinitrd -c -k 5.4.25 -w 5 -f ext4 ...etc

When I run mkinitrd with a module list like '-m ext4:jbd2:mbcache' the output shows jbd2 and mbcache
being added twice, I think this isn't a problem, but I always run '-m ext4' and it works.

If you run the huge kernel there isn't need of adding ext4 to the initrd, as you wrote it is in the kernel.


My experience running Slackware from a usb disk it that even the huge kernel needs the usb modules to boot.
This is from some years ago so maybe that changed, I don't know.

I found my mkinitrd command line to boot from usb.
Code:
-m ext4:xhci-pci:xhci-plat-hcd:usb-storage:ehci-pci:ehci-platform:ohci-pci:ohci-platform
IIRC xhci-pci and xhci-plat-hcd are for USB 3
ehci-pci and ehci-platform are for USB 2
ohci-pci and ohci-platform are for USB 1.1
 
Old 03-28-2020, 01:07 PM   #11
zdolar
Member
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 177

Original Poster
Rep: Reputation: 38
Paulo2 many thanks for the help!


A key was -w 5 in a mkinitrd script! All other options were correct all the time.


Years ago, when I did that I used SSD disk, now I tested with spare old hard disk. So at a past there was no need to use -w, with that old disk it is a must.
 
Old 03-29-2020, 02:17 PM   #12
zdolar
Member
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 177

Original Poster
Rep: Reputation: 38
The complete manual for creating initrd in /boot after installing slackware from media:
Needed procedure when booting installed slackware from a USB device.

DO NOT reboot after slackware install in a USB disk, instead follow this manual.

Installed Slackware from a USB disk - no kernel USB drivers in kernel, only modules


replace ALL occurrences of a partition names /dev/.. with PARTUUID get by blkid

/etc/fstab:

Quote:
PARTUUID=fe50e8fe-01 / ext4 defaults ...

lilo.conf


general part:
Quote:
append=" root=PARTUUID=fe50e8fe-01 "
- spaces at start and end!

Bootable partition part:
Quote:
addappend=" kernel config options "
initrd=/boot/initrd.gz
Creating initrd:

After booting with the install stick, open two terms (with CTRL-ALT-F1 and CTRL-ALT-F2). use the first terminal to mount partitions properly, e.g. :

Quote:
mkdir /mnt/slash
mount -t ext4 /dev/boot_partition /mnt/slash
Then I built a jail in /tmp with the following script :

Quote:
dirs="/dev \
/proc \
/sys \
/mnt/slash/bin \
/mnt/slash/boot \
/mnt/slash/etc \
/mnt/slash/home \
/mnt/slash/lib \
/mnt/slash/lib64 \
/mnt/slash/lost+found \
/mnt/slash/media \
/mnt/slash/mnt \
/mnt/slash/opt \
/mnt/slash/root \
/mnt/slash/run \
/mnt/slash/sbin \
/mnt/slash/srv \
/mnt/slash/tmp \
/mnt/slash/usr \
/mnt/slash/var"


for d in $dirs ; do mkdir -p /tmp/jail/`basename $d` && mount -B $d /tmp/jail/`basename $d`; done
In the second terminal (CTRL-ALT-F2) I do a chroot, and ran mkinitrd_command_generator.sh :

Quote:
chroot /tmp/jail
/usr/share/mkinitrd/mkinitrd_command_generator.sh
This generates mkinitrd line, that must be executed like this:

Quote:
mkinitrd -c -k 5.4.25 -w 5 -f ext4 -r UUID=202a8463-30c8-4806-8631-02a54da3090b -m usb-storage:xhci-hcd:xhci-pcihci-pci:ehci-pci:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd2:mbcache:crc32c_intel:crc32c_generic:ext4 -u -o /boot/initrd.gz
The abovel line MUST have UUID name of a root partition instead /dev/sd..
Replace kernel number accordingly.

run lilo:

Quote:
lilo -r /root_mount_point -b /boot_disk
-r /mnt/hd/root
-b /dev/sdb - disk, not partition!

reboot

Last edited by zdolar; 03-29-2020 at 02:18 PM. Reason: add last line
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot problem on USB HDD: can't find /mnt in /etc/fstab error xiongnu Slackware 10 06-09-2019 05:05 AM
[SOLVED] mount: can't find /mnt in /etc/fstab alberg Slackware - Installation 4 06-26-2016 08:08 AM
server startup error: "cannot find / in /etc/fstab or /etc/mtab"; /etc/fstab readonly knee-co Linux - Newbie 8 09-12-2010 05:37 PM
fstab problem: mount: can't find dvd in /etc/fstab or /etc/mtab Nikon01 Slackware 5 11-17-2006 06:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration