Installing Linux in external USB HD


Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Thread: Installing Linux in external USB HD

  1. #1
    Join Date
    Feb 2008
    Location
    Belgium
    Posts
    38

    Installing Linux in external USB HD

    After reading Saikee's howto I decided to give it a go and tried to put a linux OS in my Iomega 320GB external HD. It was not an easy ride but finally...
    I tried linuxMint who flatly refused (it stalled at 15%)
    Tried PCLinux(an easygoing I thought) and it did install but would not let it's bootloader install in its own root partition (in my case sdc2)
    Tried Mepis7 and this one worked sort of:
    I put it in my Kubuntu boot/grub/menu.lst(since Kubuntu's Grub runs every bootable thing on my desktop) but the "lazy" way didn't work (root-chainloader-boot) I had to put in the kernel and also an initrd file which surprised me because in the mepis boot/grub/menu.lst it doesn't have one. So I just put in initrd /boot/initrd.img and that was enough.Without that it just kernel-panicked but having a boot grub CD I didn't!
    When I booted first time and choose Mepis on hd2,1 he wanted to start the external disk(which is already on) so what he actually did was turning it off! Had to fix that in winXP strangely enough (it's a dell PC with winXP preinstalled)
    So finally I was able to boot Mepis on an external USB HD and it is running fine now. I am writing this from it.Looking around for some more distros to try out.

  2. #2
    Join Date
    Jan 2004
    Location
    Toronto, Canada
    Posts
    763
    hmm....odd that you had such trouble installing to an external drive.

    I successfully installed Fedora 6(i think it was 6) and Suse 10.1. The installation went like any other regular installation.
    Check out the Unix/Linux Administration Program at Seneca College.
    Thanx to everyone that helped/helps me on this forum!

    t0mmyw on #linuxn00b

  3. #3
    Join Date
    Feb 2008
    Location
    Belgium
    Posts
    38
    Yes very odd. I installed 10 linux distros on the second internal sata HD all running without any problems. When I try to boot the external disk it switches off by itself(with the power button on) and then I have to manually switch it off and on and then it boots into mepis and everything is OK. I tried to put noapic nolapic in the mepis boot menu and then it boots right away but on a reboot it's the same old story.Very strange.

  4. #4
    Join Date
    Jan 2004
    Location
    Toronto, Canada
    Posts
    763
    any chance you have a hardware problem??
    or maybe your mother board doesn't fully support booting from usb??
    Check out the Unix/Linux Administration Program at Seneca College.
    Thanx to everyone that helped/helps me on this forum!

    t0mmyw on #linuxn00b

  5. #5
    Join Date
    Feb 2008
    Location
    Belgium
    Posts
    38
    No hardware problem that I now of and I can boot from a usb stick or usb floppy drive so I don't think that's the problem. In the bios usb is fully supported as a boot choice.

  6. #6
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    exsencon,

    Don't think I have distro switching itself off without my permission.

    There are at least two different ways one can booting from a USB hard disk (or a flash meny drive).

    One is to boot it as the first disk (hd0). The other is boot it as a non-1st disk.

    The first one is slightly complicated because during the installation the USB disk may not be (hd0) but 2nd, 3rd and so on as an internal disk would have taken the 1st disk name. THus the Linux is actually installed when the USB disk isn't in the 1st boot disk position. After installation one needs to tell the Bios to switch to the USB disk as the 1st disk and also amend the disk order to (hd0) in the booting instruction.

    In the second way the USB disk is just another hard disk and its MBR is not used for booting.

    So which is the way you are after?

    Not long ago I wrote this thread to describe the general problems with the USB pen drives. It is also applicable to USB hard disks.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  7. #7
    Join Date
    Feb 2008
    Location
    Belgium
    Posts
    38
    Saikee,
    I just wanted to put some distros in an external USB disk and have them boot from my grub menu as I did with distros I put in a second internal HD (sata)
    So I tried with Mepis7 and installed it in the second partition of the USB disk(the first partition being a document in nfts) and put its grub in the root(only)partition. So far,so good.
    After that I edit my Kubuntu grub (he is in the MBR of the first internal disk) and tried a chainload with
    title Mepis7 in hd2,1
    root (hd2,1)
    chainloader +1
    at first it did not work apparently because the Mepis did not have a initrd statement in his grub menu.lst so I put one in and now it works.
    The problem I have is this:
    when I start the PC with the USB disk plugged in and running I get my grub menu and choose to boot Mepis in hd2,1 he tries to start my USB disk which is already running and he disconnect it somehow (the light on the disk goes out) so I have to switch the power button on the USB disk off and back on and then it will boot and I get my Mepis in the USB disk. Very strange.
    When I boot a linux or winXP on my internal HD the external disk is plugged in also and running normally;only when I try to reach the linux on the USB disk I have to switch the power button off and on again.
    Otherwise everything is running allright.

  8. #8
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    That is most unusual. I take it the USB disk you are referring to is a hard disk and not a pen drive if it has its own power supply.

    May be you should try another distro to see if the same thing happens with it.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  9. #9
    Join Date
    Feb 2008
    Location
    Belgium
    Posts
    38
    That's right it is a Iomega USB 2.0 320GB external HD.
    I tried to install another distro. LinuxMint,Ubuntu wouldn't install at all,Mandriva 8 installed but wouldn't boot. He got my ext disk as sdf, it should be sdc really.
    Installed PCLinux who decided my ext disk was sdg. He didn't boot at first but when i did it from a grub prompt he gave me a different kernel than the one who is in its menu.lst and...it booted with that after switching off and on my ext drive (that didn't change). So I put that kernel statement in its grub and he is happy with that.
    Conclusion: I now have two distros running from my ext USB drive(Mepis and PCLinux) after switching off and on after startup.
    When the PC starts and I choose my distro in the USB drive he disconnects it (the power light goes out) and I get: Error 25 disk read error
    Then I switch my USB drive off and on and everything is running fine.
    Even at the grub prompt when I do:
    root (hd2,2) or (hd2,1) I can hear the USB disk trying to startup but it's already running so it goes out really and I also have to do my switching to continue with my grub prompt.
    When I run linux distros from my internal disk,everything is normal.
    I am not sure if this has anything to do with a particular linux, it rather seems general. I think I will try Fedora8 on it and maybe connecting the drive to my laptop and see what happens. Any thoughts?

  10. #10
    Join Date
    Feb 2008
    Location
    Belgium
    Posts
    38
    Follow up. I installed Fedora8 in the external USB disk with the same little problem but besides that it boots allright. So it must be some problem with the USB disk configuration I think,not with the linux distros. I will connect it to my laptop in the WE to see what happens there.

  11. #11
    Join Date
    Feb 2008
    Location
    Belgium
    Posts
    38
    Now I tried to plug the external USB drive in my laptop but it is even worse. Although every OS I have in there (WinXP,Ubuntu,Suse10.2,Dreamlinux,Slax) recognizes the USB disk as being sdb and showing me everything that's in there,it won't boot any of the OS I have in there(Mepis,PCLinux,Fedora8) I tried a grub prompt and I get
    Error25 Disk read error or
    Error21 Selected disk doesn't exist
    Well, the disk is there, it is in every OS I run on this laptop and it is also there when I run my live Gparted CD. I am doing something wrong for sure but what?

  12. #12
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    Could this be due to the same disk being recognised by different device names?

    Just imagine you have installed the distro by a desktop recognising the external disk as sdf, your post #9 stated, then of course it will not boot in a laptop seeing it as a sdb because the device being booted does not exist.

    In such case, where you intend to use the Linux from PC to PC, you should have installed the Linux as a Live CV mode, with footprint the same size as a Live CD. The Linux can then boot up each time as a Live CD and never get installed. This installation amounts to mount the iso image on a loop back device to expand its filing system so that you can read it, copy the content into a USB device and subtitute the CD-based bootloader isolinux with Grub.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  13. #13
    Join Date
    Jan 2004
    Location
    Toronto, Canada
    Posts
    763
    Maybe set your fstap to use UUID's instead of device names??
    just a thought. Not sure if that would actually help.
    Check out the Unix/Linux Administration Program at Seneca College.
    Thanx to everyone that helped/helps me on this forum!

    t0mmyw on #linuxn00b

  14. #14
    Join Date
    Dec 2007
    Location
    Minnesota
    Posts
    11

    /dev/sd* fix

    Have a look at this thread:
    http://mepislovers.org/forums/showthread.php?t=11089
    In particular, post #25. Using the UUID, it doesn't matter how many internal drives are there, Linux finds the right partitions to use.

    I currently have Mepis 7.0 installed on a USB 60GB drive, and have run it on 15 different PCs so far. I boot completely off the USB drive, Grub is installed on the MBR of that drive. The only issue I still run into is how the xserver is configured, and which drivers it uses. Many of the machines use a different video card. Most of the time the stock VESA drive will work. If not I log in as root at the prompt, type in the command
    Code:
    dpkg-reconfigure xserver-xorg
    run through the reconfiguration, choosing the correct video card, then
    Code:
    /etc/init.d/kdm restart
    and all is well again.

    I primarily use it for cleaning up viruses off windows machines, and cloning ntfs drives. I also use it when traveling, instead of relying on a faulty OS of the "borrowed" PC

    Al

  15. #15
    Join Date
    Feb 2008
    Location
    Belgium
    Posts
    38
    I tried all your suggestions-no luck.
    When I boot from the laptop grub gives the same error 25 Disk read error.
    Looks like he just cannot read the disk so it doesn't really matter what I put in fstab or menu.lst.
    Now the strange part comes when I boot in say, Ubuntu on the laptop and I go into a terminal and first I do a fdisk:

    Disk /dev/sda: 120.0 GB, 120034123776 bytes
    255 heads, 63 sectors/track, 14593 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xd0f4738c

    Device Boot Start End Blocks Id System
    /dev/sda1 1 14 112423+ de Dell Utility
    /dev/sda2 * 15 5751 46082452+ 7 HPFS/NTFS
    /dev/sda3 5752 14201 67874625 5 Extended
    /dev/sda4 14202 14593 3148740 db CP/M / CTOS / ...
    /dev/sda5 5752 6787 8321638+ 83 Linux
    /dev/sda6 6788 7297 4096543+ 82 Linux swap / Solaris
    /dev/sda7 7298 9911 20996923+ 83 Linux
    /dev/sda8 9912 12077 17398363+ 83 Linux
    /dev/sda9 13098 14201 8867848+ 83 Linux
    /dev/sda10 12078 13097 8193118+ 83 Linux

    Partition table entries are not in disk order

    Disk /dev/sdb: 320.0 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x292dc8d8

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 5737 46082421 7 HPFS/NTFS
    /dev/sdb2 5738 8287 20482875 83 Linux
    /dev/sdb3 8288 10837 20482875 83 Linux
    /dev/sdb4 10838 38913 225520470 5 Extended
    /dev/sdb5 * 10838 13387 20482843+ 83 Linux

    This is what it should be really
    Next, in the same terminal I do a grub prompt and a geometry:

    grub> geometry (hd0)
    drive 0x80: C/H/S = 38913/255/63, The number of sectors = 625142448, /dev/sdb
    Partition num: 0, Filesystem type unknown, partition type 0x7
    Partition num: 1, Filesystem type is ext2fs, partition type 0x83
    Partition num: 2, Filesystem type is ext2fs, partition type 0x83
    Partition num: 4, Filesystem type is ext2fs, partition type 0x83

    grub> geometry (hd1)

    Error 21: Selected disk does not exist

    What he gives in (hd0) is my external USB disk! So I did a (hd1) thinking he might have switched the disks but-no disk.
    Why grub here got the USB disk albeit with the wrong number and doesn't get the internal laptop disk is beyond me because at boot he cannot read it.
    I then decided to reinstall Mepis on the USB disk from the laptop but with the same result. Very strange really.
    At boot grub cannot boot a linux in the USB disk because he cannot read the disk and in a linux on the laptop disk he gives the USB disk as being hd0 and forgets about the internal laptop disk. Any thoughts?
    I think I will switch the external disk back to my desktop,at least it's booting by switching in off and on.
    Last edited by exsencon; 04-19-2008 at 11:08 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •