LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices

Reply
 
Search this Thread
Old 12-20-2011, 02:59 PM   #1
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,190

Rep: Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024
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.
    Code:
    lsmod|sort>lsmod1
    Then, plug in the external hard disk, wait a few seconds for it to sync then run
    Code:
    lsmod|sort>lsmod2
    Check the drivers needed for EXT to boot and not previously loaded, e.g.
    Code:
    bash-4.1$ diff --side-by-side --suppress-common-lines lsmod2 lsmod1
    uas                     6474  0                               <
    usb_storage            34748  0                               <
    bash-4.1$
  4. Mount EXT's root partition, e.g.
    Code:
    root@machine:~# mount -t auto /dev/sdb2 /mnt
  5. Change the root directory to be /mnt, so that you execute next step inside EXT:
    Code:
    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:
    Code:
    boot=/dev/sdb2
    ...
    image = /mnt/boot/vmlinuz
      root=/dev/sdb2 
      append="rootdelay=30"
      label = Linux
      read-only
    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:
    Code:
    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.
    Code:
    lilo -t -v -C /mnt/etc/lilo.conf
    then if all goes well apart from some warnings
    Code:
    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.
    Code:
    bash-4.1# blkid /dev/sdb2
    /dev/sdb2: UUID="0c698508-4662-4d53-b18f-064aa97d1301" TYPE="ext4" 
    bash-4.1#
  11. Then edit /mnt/etc/fstab accordingly, e.g.
    Code:
    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.

Last edited by Didier Spaier; 01-06-2012 at 11:25 PM. Reason: Make the texte shorter and easier to read (I hope)
 
Old 12-26-2011, 12:36 AM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello Didier,

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

Kind regards,

Eric
 
Old 06-13-2012, 11:35 AM   #3
sgmart
LQ Newbie
 
Registered: Jun 2012
Location: Mexico
Distribution: Slackware Linux
Posts: 6

Rep: Reputation: 0
Hello Didier Spaier,
It's a great article, congratulations!

Can you detail me the six step, please?

Last edited by sgmart; 06-15-2012 at 02:42 PM.
 
Old 06-13-2012, 03:08 PM   #4
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,190

Original Poster
Rep: Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024
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.
Code:
cd /usr/src/linux-2.6.37.6 # 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:
Code:
make
make modules_install
cp arch/x86/boot/bzImage /boot/<kernel_name> # adapt accordingly for a different architecture
cp System.map /boot/System.map-<kernel_name>
cp .config /boot/config-<kernel_name>
Then go to step #7

Last edited by Didier Spaier; 06-13-2012 at 03:26 PM. Reason: wrong path corrected after "make modules_install"
 
1 members found this post helpful.
Old 06-15-2012, 02:41 PM   #5
sgmart
LQ Newbie
 
Registered: Jun 2012
Location: Mexico
Distribution: Slackware Linux
Posts: 6

Rep: Reputation: 0
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. (:
 
Old 10-29-2012, 08:31 AM   #6
Suliskongen
LQ Newbie
 
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
hi.

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?
 
Old 10-29-2012, 10:19 AM   #7
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,190

Original Poster
Rep: Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024
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.

Last edited by Didier Spaier; 10-29-2012 at 10:21 AM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Copy of IBM Server hard disk data to Another USB External Hard disk mazharcdn Linux - Server 2 09-02-2009 12:41 AM
60GB laptop hard disk & 200GB external USB hard disk linux compatibility powah Linux - Hardware 0 03-07-2006 10:55 AM
Installation problems with usb external hard disk imranamdam Slackware 1 11-06-2004 08:43 PM
Installation problems with usb external hard disk imranamdam Linux - Hardware 2 11-06-2004 07:54 AM


All times are GMT -5. The time now is 06:54 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration