SlackwareThis Forum is for the discussion of Slackware Linux.
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.
Hi!
I want to switch from booting by device (root=/dev/sda1) to booting by UUID (root=UUID=...) or by label (root=LABEL=....)
So I need initramfs.
Initramfs support enabled in .config as built-in (*), compression method set to XZ.
What I did till now: I ran mkinitrd generator script and followed supposed command:
Initrd.gz was created and installed at /boot as well as initrd-tree.
However I do not see there System.map or something similar.
Relevant part of grub.cfg looks like this:
Code:
linux = vmlinuz-3.10.17-cust root=/dev/sda1 ro
initrd = /boot/initrd.gz to grub.cfg and rebooted.
When trying to boot, I getting kernel panic.
If I deleting initrd string from grub menu, system boots fine.
AFAIK labeling your devices by UUID or LABEL doesn't create a need for an initramfs
This notwithstanding, it's hard to say if your initrd tree ships the needed modules.
Maybe you could try /usr/share/mkinitrd/mkinitrd_command_generator.sh to generate the mkinitrd command if you insist using an initrd (assuming you do that on Slackware, of course).
As you use a customized kernel, you should copy yourself the System.map file from the corresponding kernel tree to /boot.
I tried to boot by UUID and by label without initrd, it leads to kernel panic with code (0,0).
In Gentoo I had to use initramfs to point root partition by UUID or LABEL, so assuming it should be the same in Slackware, since I do not use huge kernel.
Copying System.map from /usr/src/linux to /boot doesn't help.
I have all the modules I need to mount root partition already built in kernel, may it lead to kernel panic?
I do not need huge kernel as it is. I tried to use it with above options enabled with the same result: it boots by block device name only, attempt to load initrd leads to panic.
My fstab line is correct.
fstab doesn't require to set fifth and sixth columns to value of "1".
Fifth column shows should filesystem be dumped by dump command or not.
Sixth column indicates whether filesystem needed to be checked with fsck and describes the order in which filesystems must be checked.
I do not need neither to dump nor to check filesystem, so these columns set to "0".
Moreover, these columns may be omitted:
My fstab line is correct.
fstab doesn't require to set fifth and sixth columns to value of "1".
Fifth column shows should filesystem be dumped by dump command or not.
Sixth column indicates whether filesystem needed to be checked with fsck and describes the order in which filesystems must be checked.
I do not need neither to dump nor to check filesystem, so these columns set to "0".
Moreover, these columns may be omitted:
Strictly speaking you're right. But in Slackware the root filesystem is checked by default anyway. In /etc/rc.d/rc.S:
Code:
# Check the root filesystem:
if [ ! $READWRITE = yes ]; then
RETVAL=0
if [ ! -r /etc/fastboot ]; then
echo "Checking root filesystem:"
/sbin/fsck $FORCEFSCK -C -a /
RETVAL=$?
fi
# An error code of 2 or higher will require a reboot.
if [ $RETVAL -ge 2 ]; then
# An error code equal to or greater than 4 means that some errors
# could not be corrected. This requires manual attention, so we
# offer a chance to try to fix the problem in single-user mode:
if [ $RETVAL -ge 4 ]; then
echo
echo "***********************************************************"
echo "*** An error occurred during the root filesystem check. ***"
echo "*** You will now be given a chance to log into the ***"
echo "*** system in single-user mode to fix the problem. ***"
echo "*** ***"
echo "*** If you are using the ext2 filesystem, running ***"
echo "*** 'e2fsck -v -y <partition>' might help. ***"
echo "***********************************************************"
echo
echo "Once you exit the single-user shell, the system will reboot."
echo
PS1="(Repair filesystem) \#"; export PS1
sulogin
else # With an error code of 2 or 3, reboot the machine automatically:
echo
echo "***********************************"
echo "*** The filesystem was changed. ***"
echo "*** The system will now reboot. ***"
echo "***********************************"
echo
fi
echo "Unmounting file systems."
/sbin/umount -a -r
/sbin/mount -n -o remount,ro /
echo "Rebooting system."
sleep 2
reboot -f
fi
So if you really don't want that you need to write /etc/fastboot and make it readable.
and the machine booted OK (with a genuine Slackware huge kernel). So I'd explore the possibility of a misconfiguration of your huge kernel. Please note though that I don't mention an initrd in /etc/lilo.conf and don't know if that could conflict with the kernel. But I somehow doubt it as a conflict usually occurs when two drivers claim the same device and the wrong one wins.
Last edited by Didier Spaier; 01-15-2015 at 09:49 PM.
Well, I've gone with huge kernel. I copied huge kernel's config from installation cd and build kernel with it.
The only change I did in menuconfig - I added "-huge" string to kernel name. So it's a default huge kernel.
After that I built initrd for this kernel. I added few modules to initrd: ext4, usb_storage, ehci_hcd, xhci_hcd and set root to /dev/sda1. I saw that these modules was built and installed into initrd-tree (checked it).
When I trying to boot I see messages that those modules was loaded with insmod command.
After that, when it goes to mount root filesystem, I getting error.Initrd complains that /mnt/root not found and sda1 cannot be mounted hence. It drops me into shell. Being in shell, I checked initrd-tree, indeed there is no /mnt/root directory.
I created this directory and tried to mount sda1 there: still "no such file or directory".
When I exit shell, boot process tries to continue, but ends up with kernel panic.
and you should remove the root=/dev/sda1 from your grub.cfg.
Alternatively, if the necessary filesystem and SATA/PATA drivers are built into the kernel you can try using PARTUUID instead, which doesn't require a initramfs (I've tested this on my UEFI GPT system using a custom 3.14.28 kernel, EDIT: I don't know if this works for MBR systems).
Quote:
Originally Posted by Teufel
After that, when it goes to mount root filesystem, I getting error.Initrd complains that /mnt/root not found and sda1 cannot be mounted hence. It drops me into shell. Being in shell, I checked initrd-tree, indeed there is no /mnt/root directory.
I created this directory and tried to mount sda1 there: still "no such file or directory".
When I exit shell, boot process tries to continue, but ends up with kernel panic.
Did you check what devices are present in /dev? Is /dev/disk present and if so, what does it contain?
As far as I understood, the problem occurs due to missing devices.
I completly removed all initrds and initrd-tree and started from the beginning.
Created new initrd and initrd-tree by running
Checked /boot/initrd-tree/dev directory for block devices, there are two devices: *sda and *sda1
After that I re-ran mkinitrd (without parameters) to apply changes to initrd.
On reboot I see that modules loaded (lsmod confirms it), however sda and sda1 devices are missing in /dev directory.
So there is nothing to mount and boot process stops with complains that device UUID=a7112bd0-a352-4dd7-8379-0515908c5dd0 not found.
I tried to run
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.