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.
Is the USB drive booting with a Zenwalk kernel? That might be the problem if so.
If I'm correct the Zenwalk kernel comes with "ATA/ATAPI/MFM/RLL support" disabled, and uses the SATA subsystem for both PATA and SATA drives. The result is that all drives end up as /dev/sdX where X=a,b,c,d etc.
I remember thinking of this as a neat feature, but also remember some strange behaviours similar to the ones described by you.
Do you see any printouts when it gets stuck in the loop?
There is a presumably working .config in my wiki that you could try if everything else fails..
Last edited by uppman; 11-25-2008 at 01:45 AM.
Reason: Typo, sdaX should be sdX
not sure what level of detail you need. I'm using a Dell notebook. The internal HD is standard IDE disk, 80 GB, Hitachi. The USB disk is a Trekstor, 80 Gb, should be USB 2.0 compatible.
@uppman:
yes, on the USB I've installed ZW Core, made a kernel update using ZW netpkg tool. No customization of the kernel.
And indeed, all drives follow the /dev/sdxy naming convention.
When the initrd goes into the loop I see the messages about partitions being found. However, so far I've no idea how to get a printout of these messages or to redirect it to a file. The only idea that comes to my mind is to set the value for the sleep command to 100 to gain more time to read it and make appropriate notes.
I will change the init (@ home), set the sleep value to 100, re-build the initrd, test with and without the internal HD and let you know what the printout says.
what do you mean by "post the mkinitrd that you created"?
I've
1) installed the mkinitrd script (latest version downloaded from the ZW repository)
2) substituted the init file in /boot/initrd-tree with the one provided by Magnus Uppman for SW V12
3) edited the init file in two places - the label of the partition to be mounted as root and removed the # in the "sleep 10"
line
4) run mkinitrd to produce the initrd.gz
excerpt from 'man mkinitrd';
NAME
mkinitrd - create or rebuilt an initrd (initial ramdisk) using
initramfs (simple cpio+gzip).
SYNOPSIS
mkinitrd [ -F ] [ -c ] [ -f filesystem ] [ -h hibernate_partition ] [
-k kernel_version ] [ -m module1:module2:module3... ] [ -o output_file
] [ -r root_device ] [ -s source_tree ] [ -C crypt_device ] [ -L ] [ -R
] [ -V ]
DESCRIPTION
mkinitrd is used to build an initial ramdisk. An initial ramdisk is a
very small set of files that are loaded into RAM and "mounted" (as
initramfs doesn't actually use a filesystem) as the kernel boots
(before the main root filesystem is mounted). The usual reason to use
an initrd is because you need to load kernel modules before mounting
the root partition. Usually these modules are required to support the
filesystem used by the root partition (ext3, reiserfs, xfs), or perhaps
the controller that the hard drive is attached to (SCSI, RAID, etc).
Essentially, there are so many different options available in modern
Linux kernels that it isn't practical to try to ship many different
kernels to try to cover everyone's needs. It's a lot more flexible to
ship a generic kernel and a set of kernel modules for it.
OPTIONS
-F Use the contents of /etc/mkinitrd.conf as options to mkinitrd
(optional). If this is used in conjunction with any other
options passed on the command line, the command-line options
will override the config file options.
See mkinitrd.conf(5) for details.
-c Clear the existing initrd tree (by default in /boot/initrd-
tree/) first. If this is not done, running mkinitrd will add
additional modules to the existing initrd.
-f filesystem
Specify the filesystem to use for the root partition. If this
isn't given, mount will usually figure it out. This option must
be used together with the -r option in order to be beneficial.
--help Display a help summary.
-h hibernate_partition
Specify the swap partition holding the hibernation image.
I suggest that you 'man mkinitrd' to get a better understanding.
When you create initrd you must pass the correct parameters for your kernel;
Code:
excerpt from 'man mkinitrd';
NAME
mkinitrd - create or rebuilt an initrd (initial ramdisk) using
initramfs (simple cpio+gzip).
SYNOPSIS
mkinitrd [ -F ] [ -c ] [ -f filesystem ] [ -h hibernate_partition ] [
-k kernel_version ] [ -m module1:module2:module3... ] [ -o output_file
] [ -r root_device ] [ -s source_tree ] [ -C crypt_device ] [ -L ] [ -R
] [ -V ]
DESCRIPTION
mkinitrd is used to build an initial ramdisk. An initial ramdisk is a
very small set of files that are loaded into RAM and "mounted" (as
initramfs doesn't actually use a filesystem) as the kernel boots
(before the main root filesystem is mounted). The usual reason to use
an initrd is because you need to load kernel modules before mounting
the root partition. Usually these modules are required to support the
filesystem used by the root partition (ext3, reiserfs, xfs), or perhaps
the controller that the hard drive is attached to (SCSI, RAID, etc).
Essentially, there are so many different options available in modern
Linux kernels that it isn't practical to try to ship many different
kernels to try to cover everyone's needs. It's a lot more flexible to
ship a generic kernel and a set of kernel modules for it.
OPTIONS
-F Use the contents of /etc/mkinitrd.conf as options to mkinitrd
(optional). If this is used in conjunction with any other
options passed on the command line, the command-line options
will override the config file options.
See mkinitrd.conf(5) for details.
-c Clear the existing initrd tree (by default in /boot/initrd-
tree/) first. If this is not done, running mkinitrd will add
additional modules to the existing initrd.
-f filesystem
Specify the filesystem to use for the root partition. If this
isn't given, mount will usually figure it out. This option must
be used together with the -r option in order to be beneficial.
--help Display a help summary.
-h hibernate_partition
Specify the swap partition holding the hibernation image.
I suggest that you 'man mkinitrd' to get a better understanding.
From `man mkinitrd` in Slackware (though remember that the mkinitrd from Zenwalk may be different!):
Code:
If run without options, mkinitrd will rebuild an initrd image using the
contents of the $SOURCE_TREE directory, or, if that directory does not
exist it will be created and populated, and then mkinitrd will exit.
These options are handy for building an initrd mostly by hand. After
creating /boot/initrd-tree/, you can add modules and edit files by
hand, and then rerun mkinitrd to create the initrd.
mkinitrd without options can be a correct way to generate an initrd. I have never used this method, so I can't be much more help than that; however, doing this is sometimes required (or easier, anyway) if you are making strange modifications to initrd-tree, such as in this example.
I've played around with busybox. It has an option to support recognizing partitions by there label or UUID. Normally not ticked. So I've run make menuconfig on busybox, ticked these options, run make && make install to build and install it.
Looks like I shall use the -F switch to force mkinitrd to use busybox, right?
Try to recompile your kernel with "ATA/ATAPI/MFM/RLL support" enabled.
That will probably solve the problem.
You can add a /bin/sh in the init file (before the loop starts) to get a shell prompt and do some debugging from there. The init script will continue after you exit the shell.
Have you ever tried busybox for that purpose? I've build a new initrd using your init file for SW 12.1. I've build a statically linked version of busybox 1.12.2 with support for LABEL and UUID and copied that to /boot/initrd-tree/bin (overwriting the existing one).
By now I get an interesting result: the partition IS INDEED FOUND using the LABEL while the internal HD is installed. However, it is not being mounted. "mount -r /dev/sdb3 /mnt" plus "exit" solves the problem. "mount -r -L ZW_CORE /mnt" does not work. I'm getting something like "option --L not supported"
One more strange observation: when I open the busybox file with Midnight Commander F3, I see a text saying that busybox has been build for kernel version 2.6.18. I'm using 2.6.24.x. And as far as I remember at least ZW switched to the SDA naming convention with the introduction of kernel 2.6.20. Not sure whether this is valid for all SW- based distros. And I haven't seen an opion in busybox's menuconfig to select a specific kernel version. On the other hand, how can this work? I have only the corresponding kernel modules (2.6.24.x) installed.
Any ideas?
Thx.
The MoD
Added: looks like BB does not support "mount -L" at all. Checked findfs "LABEL=label". Result: not found. Giving up on BB for the moment. Keeps you just busy. W/o delivering the expected results.
Added: looks like BB does not support "mount -L" at all. Checked findfs "LABEL=label". Result: not found. Giving up on BB for the moment. Keeps you just busy. W/o delivering the expected results.
I tried a long time ago and gave up just like you..
/Magnus
"busybox has been build for kernel version 2.6.18." This is probably the version of your kernel headers.
It looks to me like you can make this work. If you are able to retrieve the partition label somehow, you just need to mount that partition using its' real partition info and then switch_root into the mounted directory. The problem is probably with the fstab entry which should usually match the kernel boot params. But, instead of trxing to use the label there or a hard-coded partition, just use rootfs, instead of something like this:
/dev/hdb3 / reiserfs defaults 1 1
use this:
rootfs / reiserfs defaults 1 1
This will let you mount it no matter which partition it is detected as. Of course you first need to echo the correct info into /proc/sys/kernel/real-root-dev.
I've been working with Magnus' script for quite a while now & had to modify it to get it to work with ext3. See this post. Unfortunately, I do not have a machine that will boot from USB, nor have I used Zenwalk, so can't help you there. I am now happily using "root=LABEL/*" & copying my boot partition to a couple of machines without having to modify /boot/grub/menu.lst. If you need more details on what I did, post.
Regards,
Bill
Still experimenting with the initrd build acc. to Magnus' howto.
I'v added vol_id and usb_id in the same way as blkid and awk were added including the dependencies. And I've added a /bin/sh statement in the init file to be able to play around with the initrd mounted. And I've added the mount program instead of the symlink to busybox. Because it supports "-L LABEL" option.
The result is quite interesting: "fdisk -l" and "cat /proc/partitions" always shows all partitions, no matter how many devices are present. blkid works fine as long as the internal disk is present. If I remove the internal disk, blkid does not find sda2, sda6 and sda7! vol_id os no better. Because it uses the same underlaying technique?
"mount -r -L ZW_CORE /mnt" works only if a use blkid before. Seems like blkid first fills some table (/etc/blkid.tab???) and mount uses that table?
However, this works only, as long the internal disk is present. If I remove it even "mount -r /dev/sda7 -mnt" fails - producing a "Segmentation fault".
To me that sounds like a bug.
Maybe, I shall inspect how Debian based systems solved that issue.
I've found a very easy solution to solve the problem. I can now boot the box from my USB thumb drive using /dev/sdxy, LABEL and / or UUID - whatever I want.
Here is, how I did it (finally, and with the help of many others!)
1) install mkinitrd
get the latest version from e.g. http://packages.slackware.it
run pkginstall mkinitrd-version.tgz
2) edit the init file in /boot/initrd-tree
go to section "#Parse command line" and change the following lines:
line 73 from "root=/dev/*)" to "root=*)"
line 74 from "ROOTDEV='echo $ARG | cut -f2 -d=' to "ROOTDEV='echo $ARG | cut -b6-'
save changes
3) download busybox from www.busybox.net (I'm using 1.12.2)
- untar it (using -jxf, I think)
- run "make menuconfig"
- go to "Busybox Settings --> Build Options" and set the option "Build as static"
- exit to the main menu
- go to "Linux System Utilities" and "tick" in the section "Routines for detecting label in uuid on common file systems"
the file systems you need
- go to the section "mount" and "tick" support specifiying devices by label and uuid"
- exit menuconfig and save your configuration
- run "make"
- note: there is no need to run "make install" !!!
- replace the busybox version in /boot/initrd-tree/bin with the one created in /path/busybox-version/busybox
4) adjust your lilo.conf and run "lilo -v"
my one looks like this:
image = /boot/vmlinuz
append = "root=UUID=1234abcd-5678-efgh-90ij-klmnopqrstuv"
initrd = /boot/initrd.gz
label = by_UUID
you may also use LABEL. In this case the second line looks like this
append = "root=LABEL=label"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.