Installing linux on external usb drive -> How about making a tutorial?
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.
Installing linux on external usb drive -> How about making a tutorial?
Hi
I'm writing with a question. Would it be possible to collect and make one solid tutorial for installing slackware on external usb drive?
I know there are many topics on it, but none gives straight answer how this should be done to work properly. I may be wrong and many will disagree, but I think this would be another good addition to slackware tutorials.
First of all I'm asking people, who managed to do it without pain and big problems, to write possibly clear and brief tutorials with every step descirbed in detail.
I'm not new in slackware, but since I got external usb drive I can't make it work, although I've read all posts related to installation on external usb drives...
...so I'm looking for a solid and described in detail procedure. As there are probably many people looking for solution like this, collecting all into one tutorial would be good idea.
I thought about tutorials for 2.4 and 2.6 kernels.
What do you mean by "installing on an external USB hard drive?" I've got a really old computer with an 800MB hard drive and the CD-ROM doesn't work. I'm going to borrow my friend's USB to IDE cable and (try to) install Slackware on to the hard drive using my laptop. Is this what you're looking for?
It is more less what you say. I want to make full installation of slackware on my external usb hdd na have it capable of booting from it. What is more I'd like it to use 2.4 series kernel rather than 2.6... an of course lilo as bootl loader.
I have mainboard that makes it possible to boot from usb devices and I want to make use of this feature.
That's my point.
I installed Slackware on a 1 GB USB flash drive with success and I am able to boot it with every notebook/pc which is able to boot from external USB drives. I am now in hurry but tonight I will be back to give a short how-to ...
I installed Slackware with all my preferred software and the newest kernel to my harddisk. I use GRUB to boot Slackware with my intern harddisk.
To prepare the installation on a USB harddisk I created on the intern harddisk an initrd.gz, which contains the needed modules for USB/extern so that the root filesystem can be mounted and the boot process starts indeed from the USB disk.
Do this in a terminal as root:
cd /boot
mkinitrd -c -k 2.6.13 -m ehci-hcd:uhci-hcd:ohci-hcd:usb-storage <-- you insert here YOUR kernel-version 2.xy.xy and if your acpi doesn't work eventually needed ACPI-drivers (ac:fan:battery:button:container:processor:thermal)
Then you find the created initrd.gz in the directory /boot.
This initrd.gz I figured out in the following way, so that after loading the USB modules quite in the beginning of the boot process the system has enough time to initialize the connected USB drive.
Do this in a terminal as root:
cd /tmp
mkdir initrd-new
cd initrd-new
cp /boot/initrd.gz .
gunzip initrd.gz
mkdir work
mount -o loop initrd work
cd work
mcedit (or vi or vim or another texteditor) linuxrc
Now insert these lines in the opened linuxrc after line 69 before the line with "Initialize LVM":
echo "Detect and initialize USB drives ..."
sleep 10
Then save and close the file linuxrc and go on with:
cd ..
umount work
rm -R work
gzip -n9 initrd
cp initrd.gz /boot
cd ..
rm -R initrd-new
Close the terminal.
Now plug in your USB drive and format it with ext2/ext3 (if you choose reiserfs or xfs you have to add the needed modules to the initrd.gz so that the root filesystem can be mounted). Then mount it and open a terminal and type as root (now you copy your Slackware installation to the external USB drive):
cd /
cp --preserve -R /{boot,bin,dev,etc,home,lib,mnt,opt,root,sbin,usr,var} /mnt/sda1 <-- where your USB drive is mounted, here it is /mnt/sda1
cd /mnt/sda1
mkdir (proc,sys,tmp)
Then install GRUB (it must be installed on your harddisk) to your USB drive and write:
grub-install --root-directory=/mnt/sda1 /dev/sda
When finished the GRUB installation go on in the terminal as root:
cd /mnt/sda1/boot/grub
rm menu.lst <-- it is not a number 1 but a l
mcedit menu.lst (or vi or vim or another texteditor)
Here you insert the following or similar text:
color light-gray/blue
fallback 0
timeout 10
default 0
#
title Slackware
kernel /boot/vmlinuz root=0x801 ro vga=0x317 <-- 0x801 means the same as /dev/sda1
initrd /boot/initrd.gz
#
Save and close the file menu.lst.
Umount the USB drive and reboot.
Everything should work fine and Slackware should boot from external USB drive or harddisk.
I use kernel 2.6.13, I don't know if it will work with a 2.4.xy kernel. I use the generic kernel without any changes, I added only the ACPI modules to the initrd.gz, because this is a way to force hardware to a proper ACPI with fan, battery, lid and button.
Try it and I hope that I could write everything in a clear matter (English is not my mother language ...).
Fluxx.
P. S. If there is an error during loading GRUB after Stage 2 "Error 21" it is a BIOS problem on some notebooks/pcs. Then you can use "extlinux" if you use "ext2/3-filesystem" to boot the USB drive. It works fine for me on some notebooks.
Before making usb hard drive bootable I made a full slackware installation on that disk using default, bare.i kernel. I made initial configuration of all services and finished installation process without errors.
Today I tried your solution, but made some modifications since the only OS I have is on the usb drive I try to boot up
..and so
First of all I didn't touch 2.6 kernel and did all on default 2.4(.31)
Because I cannot boot slackware even with default CD1, after booting into "installation mode" I just activate swap and initialize /dev/sda2 partition (the one with linux). Then I chroot to /mnt, where I have existing slackware installation mounted... and then I can do thing you mentioned in your posts.
Bootloader:
...since I couldn't make it work with lilo, I tried grub as you did and I found it more succesful solution for usb drives. In my case lilo was always terminated with "L" at boot time.
Finally going step by step through your howto I made it work, but... I got lots of messages telling me, that modules in initrd-tree aren't ELF files. Few people reported problem on similar topics and it turned out that modules in initrd.gz shouldn't exist as compressed (.gz) files. Running gunzip on each module in initrd-tree and repeating mkinitrd without params was a solution for that.
To make sure I ran grub-install one more time.
I finally got it boot up. Grub started without any problems and loaded kernel and initrd.gz. Everything went fine and usb devices where detected properly. This stage was finished with success.
After that, all standard services began to initiate. Until that moment everything was ok.
When I reached "Going multiuser..." a line below appeared:
/etc/rc.d/rc.inet1: /sbin/ifconfig Io 127.0.0.1
...and that's it. I'm stuck again
Any ideas? In slackware setup I set network to use dhcp and disabled all rc. 's available(shown) in one of the last stages of installation process.
You're right, I may not be clear enough. One of the last stages of slackware installation is a dialog in which user selects the services to run after succesfull boot up, such as rc.inet, rc.pcmcia, rc.syslog and so on... So I choosen none from above and continued setup.
..and no, I didn't touch other scripts in /etc/rc.d. I made clean, standard installation, without any extras.
I boot up and simply everything freezes after the line I mentioned in previous post.
I think (I never did a Slackware 10.2 installation) that some important rc.files are not set +x so that they cannot start.
Just after your system stops booting the rc.syslog and the rc.hotplug would start to detect hardware. May be here is the problem. May be that rc.hotplug is running and stops because of a hardware problem. The output of dmesg or /var/log/messages could give more informations ...
Here a few lines of the output of my /var/log/messages:
I chcecked my /var/log/messages but found nothing :/
Here are few lines of mine output:
...
Sep 21 17:59:19 cytrynka kernel: agpgart: AGP aperture is 64M @ 0xe0000000
Sep 21 17:59:19 cytrynka kernel: scsi1 : SCSI host adapter emulation for IDE ATAPI devices //I guess that after this line it goes multiuser
Sep 21 17:59:19 cytrynka logger: /etc/rc.d/rc.inet1: /sbin/ifconfig lo 127.0.0.1
..and that's it. System stops and nothing happens In installation I set my network to use dhcp (I have router dhcp-enabled) as in my win os.
After reading initrd.gz everything is detected properly. I enabled my eth interface in rc.modules and it was found either.
In comparison to yours I began to worry, that something must have gone wrong... As you can see I never reach the moment, where rc.hotplug is executed.
I'm stuck again :/
Since it's default/generic slackware installation, I can't simply find out what went wrong(!!!)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.