-   Slackware - Installation (
-   -   Slackware 13.37 installation on an external USB hard disk - nano how-to (

Didier Spaier 12-20-2011 02:59 PM

Slackware 13.37 installation on an external USB hard disk - nano how-to
Hello all,

I have an external USB hard disk, mainly used for backups. As it is 1 TB wide I decided to install Slackware 13.37 on it, just for fun.

At first I didn't succeed, so here is what I did to eventually get it done.

Before we begin, I suppose that you have:
  • Slackware 13.37 already installed on an internal hard disk
  • your machine's BIOS configured to try booting on an external USB storage device before the internal HDD
  • already setup (at least) two partitions on your external USB hard disk. On mine I'll call them /dev/sdb2 (partition type Linux) and /dev/sdb3 (partition type Linux swap)
For the sake of brevity I'll call INT the internal Slackware 13.37 (already existing) and EXT the external one (that we are going to install).
  1. Launch Slackware's installer and choose /dev/sdb2 as / target partition and /dev/sdb3 as swap, or whatever names they are given at this point of time.
    Of course double check your partition's names with fdisk or cfdisk before running setup, otherwise you could very well mistakenly erase something you would miss a lot afterwards ...
    I suggest you install lilo in the process of EXT's installation. You will have to re-install it later but at least you'll have a lilo.conf ready to be edited. I chose to install it on /dev/sdb2 (EXT's root partition) which I had made bootable.
  2. Boot INT, after having unplugged your external HDD.
  3. Some kernel drivers are necessary to mount EXT's root partition early during the boot sequence.
    To identify them, first take a note of the already (i.e., before the external HDD be plugged in) loaded kernel modules, e.g.

    Then, plug in the external hard disk, wait a few seconds for it to sync then run

    Check the drivers needed for EXT to boot and not previously loaded, e.g.

    bash-4.1$ diff --side-by-side --suppress-common-lines lsmod2 lsmod1
    uas                    6474  0                              <
    usb_storage            34748  0                              <

  4. Mount EXT's root partition, e.g.

    root@machine:~# mount -t auto /dev/sdb2 /mnt
  5. Change the root directory to be /mnt, so that you execute next step inside EXT:

    chroot /mnt
  6. Re-using information gathered during step #3, either
    - make an initrd including all the needed kernel drivers for EXT to boot properly
    - or recompile then install your kernel with these drivers built-in the kernel (not as modules)
    I chose the second way.
    I won't elaborate about the needed drivers, as the list can vary depending on your hardware and the kernel you choose.
    You will certainly need to have 'usb-storage' and probably 'uas' built-in. To make good measure I made 'ehci-hcd', 'uhci-hcd' and 'ext4' built-in as well (I started from a generic kernel).
  7. Update (or create) EXT's lilo.conf. In my case it was /mnt/etc/lilo.conf and I included in it:

    image = /mnt/boot/vmlinuz
      label = Linux

    If you go by the initrd way, don't forget to tell where is the initrd file in the "image" section.
    Don't forget the "rootdelay=" kernel parameter, otherwise the system will probably hang during startup with the infamous:

    Kernel panic - not syncing: VFS: Unable to mount the rooot fs on unknown block(0,0)
    You can shorten the delay if EXT's USB root partition is available is less than 30 seconds.
  8. Hit Ctrl+d or type "exit" to go back to INT.
  9. Run lilo in testing mode, telling it to use the config file you just edited, e.g.

    lilo -t -v -C /mnt/etc/lilo.conf
    then if all goes well apart from some warnings

    lilo -v -C /mnt/etc/lilo.conf
  10. I advise you to identify EXT's root partition in /mnt/etc/fstab by uuid, to prevent the consequences of a change in hard disks naming upon the registering order by the system of your storage devices. First, take a note of your EXT's root partition's uuid. You can use blkid (as root) for that, e.g.

    bash-4.1# blkid /dev/sdb2
    /dev/sdb2: UUID="0c698508-4662-4d53-b18f-064aa97d1301" TYPE="ext4"

  11. Then edit /mnt/etc/fstab accordingly, e.g.

    UUID=0c698508-4662-4d53-b18f-064aa97d1301      /                ext4        defaults        1  1
  12. Cross your fingers, then reboot with the external HDD plugged-in. Hopefully, this will start up EXT.
Now, let me congratulate you to have been able to read this _way_too_long_post_

Feed back is very welcome, especially:
  • questions
  • typos, grammar and style corrections (English is not my mother tongue)
  • errors corrections of the process description
  • simplifications
I will update this post accordingly.

EricTRA 12-26-2011 12:36 AM

Hello Didier,

Thank you very much for a detailed howto. It'll come in handy!

Kind regards,


sgmart 06-13-2012 11:35 AM

Hello Didier Spaier,
It's a great article, congratulations!

Can you detail me the six step, please?

Didier Spaier 06-13-2012 03:08 PM

Hello sgsmart, welcome to LQ.

Unfortunately I am not allowed to edit my first post in order to detail step #6, because it is more than 5 days old.

Anyway here are the details of that sixth step.

To know how to make an initrd, just follow instructions in /boot/README.initrd in Slackware 13.37

If you prefer to go by the "recompile the kernel" way, first make sure you installed the relevant kernel-source packages, that is to say the one which matches your running kernel.

Then do what follows in a terminal as root.

cd /usr/src/linux- # In case of a different kernel, adapt accordingly
zcat /proc/config.gz > .config # To make sure that the initial .config matches your running kernel
make oldconfig # maybe not necessary in this case, but won't hurt
make xconfig # "make nconfig" or "make menuconfig" will do too, but "make xconfig" makes easier to update the configuration

Now, change the kernel's configuration for each driver that should be buit-in (in my example, uas and usb_storage):
1) Find the corresponding symbol with Ctrl+F. In case of several answers, read carefully the comments for each of these to spot the relevant one.
2) Check the relevant entry to make the driver built in.

While you are at it, don't forget to check that the filesystem of your root partition be built in as well.

Oh and I suggest that you customize the local version (symbol to search with Ctrl+F: "localversion") in order to distinguish this kernel from the stock one.

Now you can save the configuration, make the kernel and install it as usual.

As a reminder:

make modules_install
cp arch/x86/boot/bzImage /boot/<kernel_name> # adapt accordingly for a different architecture
cp /boot/<kernel_name>
cp .config /boot/config-<kernel_name>

Then go to step #7

sgmart 06-15-2012 02:41 PM

I have got it!
I am now in Slackware on USB.

Thanks Didier Spaier for the reply.

I have not got "recompile the kernel", yet...

Nevertheless, I got it.

Initially, I got a frozen screen.

But I booted from Slackware DVD, into the terminal, I went to fourth step, then fifth
skip sixth, after seventh and I run lilo command.

I got some warnings, right, but I reboot and at the end I boot from USB.

Yeah!... this found for me. Although it takes more than five minutes to boot. (:

Suliskongen 10-29-2012 08:31 AM


i ran through step #3 and the list didn't show any "usb_storage" or "uas".
so i guess i am supposed to include "ehci-hcd", uhci-hcd and "ext4" with either recompiling the kernel og making an initrd?

Didier Spaier 10-29-2012 10:19 AM

Hi Suliskongen and welcome to LQ.

I guess you started with a huge kernel running, not a generic one. That would explain why you don't see usb_storage in the list as this driver is already buit in in huge kernels (thus it doesn't appear in lsmod's output as that command only lists drivers shipped as modules).

If that is the case, as the huge kernel as the saying goes already ships "everything including the kitchen's sink", steps #3 and #6 are in fact not necessary in your case (uhci_hcd, ehci_hcd and ext4 are all buit in the huge kernels as well), unless you see another kernel module in the list.

Regarding uas, if it doesn't show you simply don't need it (not all USB hard disk use that) so don't worry about that either.

But if you took as a basis a generic kernel then something is wrong: you should see at least usb_storage in the list as it is needed by all USB disks but shipped as a module in generic kernels.

All times are GMT -5. The time now is 11:47 AM.