LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   install linux on a usb drive (https://www.linuxquestions.org/questions/linux-hardware-18/install-linux-on-a-usb-drive-326488/)

kylnj 05-24-2005 01:14 AM

install linux on a usb drive
 
hi

can i install linux on a usb drive free partition?
thanks

tom

J.W. 05-24-2005 03:59 PM

Yes. However, assuming that you want to boot from it, you should confirm that your mobo supports a USB device as a booting option. Not all mobos do. -- J.W.

kylnj 05-24-2005 07:48 PM

tks jw,

but...
since my 1st drive has xp on it and has no space left.
i boot into linux from cd and start the installing steps...
during the early steps, it only show the primary drive... which i dont want to wipe it out(no space left either). it didnt show the free space on the usb drive where i want the linux to reside, and later on to boot from it!!!!

any comments?

J.W. 05-25-2005 12:56 AM

Your USB drive probably isn't mounted, or there are no partitions available on it. What partitioning scheme are you using on the USB? -- J.W.

gd2shoe 05-25-2005 01:28 AM

Statement amended because of false premise (I thought that I was still in the SuSE lq forum)

First off, which distro are you using (what "version" of linux)?

It sounds like the modules needed for the installer to see the usb drive are not loaded. You may be able to switch to a different tty and load them (it depends on the distro you're installing).

When the install is done, you may find that you need a custom built initrd (one that has the usb drivers in it). You will probably find out if this is an issue when you boot. It will probably tell you something like "cannot mount root file system".

Stick with it. It can be done.

kylnj 05-25-2005 06:32 AM

hi jw/gd2shoe

thanks for your reply, while booting it show fedora core 2.6.9-1.667.

ok here is what i try today.( dell inspiron 1100 is what i have, biosA32--having smaller display area as well)

1. i took the usb dr(half of it is ntfs partition for my XP and the rest is free) out. swap the internal/primary dr out and successfully install and i can boot w/o problem(while it is inside as the primary--with the small display).


2. then i swap those 2 drive and set bios to boot usb dr 1st. it does pickup the usb dr and starti booting but failed with following summary:


boot fedora core 2.6.9-1.667
root(hd0, 1) ---is this correct?
file system is...
...

....
uncompressing.......ok boot kernel
red hat nash ver 4.1.18 start
reading all physical volume...

no volum group found
...
...
.
.
no volum group found


mount error 6, mounting ext3
mount error 2 " "
.
.
switchroot: mount fail 22
umount /initrd/dev fail 2
.
.
kernel panic not sync kill init



well i hope someone can figure it out ??




also, i did saw a thread about dell inspiron 1100 displaying issue has been solved by up grade bios?? or using intel 845 patch can help to get a full screen?


thanks again.

tom

gd2shoe 06-02-2005 11:50 PM

(hd0, 1) is Grub's way of saying "first hard drive, second partition". This is usually equivalent to /dev/hda2 once linux is booted. (Grub is a common boot loader used with linux. It gets the kernel and initrd into memory and allows linux to start.)

Let me see if I understand correctly. You have an external Hard drive, which is only really a laptop hard drive in a USB enabled enclosure. You swapped this drive into the laptop, installed to it, and then replaced it in it's enclosure. Does that sound right?

I find it rather odd that it booted as far as it did. It obviously started the linux kernel (you can't have a kernel panic w/o a kernel).

It also looks like the kernel can't find any physical volume. This sounds to me like it can't see the other drive in the system (let alone the USB drive). I expected a more blatent error than this, but it seems to be having trouble mounting the root file system. If this is the case, you will need a custom initrd.

This project will likely be much easier if you have a "live linux" CD, like Knoppix.

Observations by somebody else? (hopefully someone better qualified...)

kylnj 06-03-2005 01:30 AM

hi gd2,
thanks for reply.

1. it is a laptop drive(in a usb 2 ext-box) with 1st partition used as e: drive for XP(while i boot from internal drive). i install fedora 3 on the 2nd partition(hopfully i can boot from either XP or fedora).

2.question: after you set bios to boot from usb drive, do you need a special usb bootable external box or any usb box will do?

thanks

gd2shoe 06-03-2005 04:23 PM

I would expect that any USB drive which lets you write to the MBR and boot sector should work as a bootable device plugged into a computer which supports USB booting. Not all USB drives will let you do that (particularly some of the small flash drives), but I think most will. If you get the same results that you posted previously without any internal drive, then I would say that the enclosure you have is not a problem.

The trick is drivers. After the POST (power on self test), the BIOS will look for the first available bootable device on it's list, and load the MBR (master boot record) from that device into memory. In your case, this is where GRUB is installed (this is a little over simplified). Grub then provides a menu, and is intelligent enough to be able to find the drive again. Grub then loads the linux kernel and the initrd into memory, and kicks the kernel into gear.

Now, the kernel starts to initialize the hardware. Before it gets too far, it too needs to read the hard drive. The problem is, it uses a more sophisticated means to communicate with the drives and their controllers. Also, once it can talk to the drive, it needs to be able to read the drives format in order to get at the files that it needs. Each of these require drivers. Some of these drivers are typically compiled into the kernel itself. Others aren't always needed. This is where the initrd comes in.

The initrd is a package of stuff that gets put into memory and is treated as a ram disk. It contains configuration scripst and modules (drivers) that the kernel might need to have before it can talk to the hard drive. This is where I expect problems with booting off of a USB drive. I could be wrong, but I don't expect most initrd files to contain the necessary modules to communicate with a USB drive.

You can create your own initrd using the mkinitrd package. This is something which I am not terribly familiar, but could probably figure out. I think that you will need to have the usbcore and usb-storage modules in order for this to work.


Also, with the other hard disk back in the system, I would expect the root command may need to be changed to (hd1,1).

You will probably want a live linux CD to work from to diagnose/fix this. The installation disk might be enough. Generally, I recommend people use Knoppix.

kylnj 06-03-2005 06:22 PM

hi gd2

thanks for your info.


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