Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ 1 [2] >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: a USB HD install, yes you read thatright: HDinstall onUSB!< Next Oldest | Next Newest >
winjimmy
Unregistered






Posted: Feb. 01 2006,19:19 QUOTE

Quote (cyberoidx @ Jan. 30 2006,23:41)
what if you suddenly lose your dataa?

Perhaps a moment of satori would just as suddenly ensue . . . ?

Anyways, I've finally got this thing booting from a boot floppy: SUCCESS! (though with some limitations). My solution was as follows: make a bootable FreeDOS boot disk with only minimal files on it for booting the system; put a copy of loadlin on it; put the DSL kernel on it (linux24); put a specially-crafted initrd (that loads modules for, then initializes the USB drive) on the diskette. Put the USB drive into the right USB slot (seems dependent to some extent on the slot it was in when you did the HD install to it), boot from the diskette, then issue
Code Sample
loadlin linux24 initrd=name-of-ur_initrd root=/dev/sdXX
(XX gets replaced by the letter and partition number of your flash drive: mine was a1 [sda1]). Then, you're off to the races. Your drive should boot--mine does. Copying over the kernel and finding a copy of loadlin was small potatoes. The specially-crafted initrd was the more painful part. For the initrd, I appropriated one from a project called "Runt" that aims to run Slack from a USB flash drive. The site is at http://runt.mybox.org . He's got a boot floppy there that'll actually boot DSL installed on a flash drive as-is: problem is it uses the wrong kernel for DSL. So you won't be able to do much on the system. To do anything, you'll have to extract his initrd from the floppy image, unzip it, mount and edit it, then re-gzip it, finally copying it over to your boot floppy. I found helpful directions for editing the initrd at http://simonf.com/usb/#older . It has you mount the unzipped initrd as a loop filesystem. You use that same process to get the gzipped initrd out of the floppy image. If there's any real interest in doing this, I can provide more detailed directions. But I'm guessing most folks are happy enough with the live-CD-from-flash-drive method of running DSL from flash. It does, apparently, make your flash drive last alot longer to do it this way.

Caveats: booting DSL this way will undo alot of the plug-and-play happiness DSL brings. When you boot from floppy like I've described, it first of all mounts the disk read-only (ro). You can't do much with the system without making it read-write (rw). That's fairly easy to do, and the kernel even spits out a final message telling you how. On top of that, none of DSL/Knoppix's hardware detection wizardry works: all that resides in initrd's big brother--minirt.gz that regular DSL/Knoppix run on boot. What this means is that you'll have to load modules by hand to get all your hardware enabled and functioning (for exampe, your NIC). So, at present, it's not for the faint of heart or extremely inexperienced. But it works for me, and gives me what I want. Depending on response, I may post further to this thread. For those with a bit of experience and/or tenacity, you should be able to figure out all this on your own from what I've said here and the links I've provided.

Be aware that USB is picky. It may not be possible to do this on some computers, or it may take a great deal of experimentation and trouble-shooting to figure out how. YMMV.

James
Back to top
winjimmy
Unregistered






Posted: Feb. 02 2006,04:23 QUOTE

Quote (Guest @ Feb. 01 2006,14:19)
Caveats: booting DSL this way will undo alot of the plug-and-play happiness DSL brings. When you boot from floppy like I've described, it first of all mounts the disk read-only (ro). You can't do much with the system without making it read-write (rw). That's fairly easy to do, and the kernel even spits out a final message telling you how. On top of that, none of DSL/Knoppix's hardware detection wizardry works: all that resides in initrd's big brother--minirt.gz that regular DSL/Knoppix run on boot. What this means is that you'll have to load modules by hand to get all your hardware enabled and functioning (for exampe, your NIC). So, at present, it's not for the faint of heart or extremely inexperienced. But it works for me, and gives me what I want. Depending on response, I may post further to this thread. For those with a bit of experience and/or tenacity, you should be able to figure out all this on your own from what I've said here and the links I've provided.

I was wrong about this. The read-only mounting problem was because I had the wrong fstab entry for the root filesystem. I set the thing up on another machine where the flash drive was sdb1, and an fstab entry was created stating that the root filesystem was there. Moving it to another machine made sda1 the location of the flash drive, thus the fstab entry was wrong and e2fsck got confused by it and would only mount the partition read-only. Once I changed the root filesystem entry to /dev/sda1, e2fsck was able to run on the drive and it got mounted read-write, like it was supposed to. What's more, the hardware detection/module-loading/network settings stuff all ran fine after this. So the plug-and-play happiness that is so characteristic of DSL/Knoppix all works fine, even on this flash drive install! I did have some hardware troubles with the flash drive though. I decided to go out and get a regular USB HD enclosure and stick one of the gazillion drives I have laying around into it. I'll see if this actually works.

James
Back to top
winjimmy
Unregistered






Posted: Feb. 03 2006,18:01 QUOTE

The external HD enclosure with a real HD in it did the trick. I've now got a portable DSL on HD I can take around to any computer that can boot from floppy and use DSL on it. Bit of a different booting/disk usage scheme than the live-CD-from-flash method, but could be prefereable in some cases. Final advice: if you wanna try something like I did, be aware that a 512MB flash drive is not large enough. A fresh DSL install takes up only about 1/3 of such a drive, but once you start running the system, and especially if you wanna add any progs, it ballons way out of scope for the 512MB. My problem was that the drive was running out of space, so I was getting error messages and the system basically ground to a halt (hard reset needed). If you wanna use a real flash drive instead of HD in an external USB enclosure, I'd recommend nothing less than 1GB.

Another potential problem is the way the drive can get assigned a different device file (e.g., /dev/sdb1 rather than /dev/sda1) on different machines. If that happens you'll get a kernel panic cuz the root filesystem can't be found (fstab entry for / is wrong). Or it will mount the drive read-only. It can take some experimentation to find out which is the right USB plug for the device name associated with the root filesystem in your /etc/fstab. Another reason why doing dsl-hdinstall to USB devices is discouraged?

James
Back to top
cbagger01 Offline





Group: Members
Posts: 4264
Joined: Oct. 2003
Posted: Feb. 04 2006,05:38 QUOTE

The main reason is that most USB devices are flash pendrive types and frugal is the preferred method to protect against premature device failure due to too many writes.  Also, frugal is more space efficient, is more easily upgraded, and is harder to "break" because the base filesystem is read-only.

However, the truth is that for linux kernel versions 2.4.x, USB storage devices (including your external hard drive) are enumerated as if they were SCSI hard drives, which is why the "sdx" naming convention is used.  Since it is possible to do a traditional hd install to a SCSI hard drive, when you get down to business, there is no good reason why you cannot accomplish what you have done.

The biggest hurdle (besides the whole "The drive is sometimes detected as "sdb" thing) is the difficulty of using traditional bootloaders ON THE SAME HARD DRIVE, to boot up the operating system.  If the target PC does not support USB hard drive booting, you get trapped unless you come up with a creative workaround.

FYI, if you want to help cut back on the "sdb" situations, please try to plug your drive into the REAR ports of the PC, preferably port 1 or 2.

Usually, the rear ports are ranked 1st in the sequence of the detection process, so your hard drive is more likely to be found as "sda" instead of "sdb".

You could also try an approach similar to KNOPPIX/DSL and create a miniroot initial ramdisk.  Instead of booting directly to your "root" filesystem, you would first boot to the miniroot filesystem, then use the linuxrc to autodetect your hd installation device name (sda,sdb,sdc, etc...) and then chroot over to this filesystem and run the "real" init process.

In theory it is possible.  It just takes some playing around to get it up and running.
Back to top
Profile PM 
8 replies since Jan. 30 2006,18:05 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ 1 [2] >/
reply to topic new topic new poll
Quick Reply: a USB HD install

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code