[TriLUG] booting off usbstick

Pete Soper via TriLUG trilug at trilug.org
Sat Jul 11 13:18:33 EDT 2020


Well the question burning in my mind, Joe, is whether you just want to 
boot off the stick or whether your root filesystem is going to be on the 
stick too?
-Pete

On 7/11/20 1:01 PM, Joseph Mack NA3T via TriLUG wrote:
> On Sat, 11 Jul 2020, Stephen P. Schaefer via TriLUG wrote:
>
> thanks for everyone's suggestions, but the task really is to boot an 
> arbitary diskless computer off a usb stick, something that's done 
> routinely with usb sticks with live file systems.
>
> The problem is that I don't know how it's done. Just for fun, about 10 
> years ago, I tried booting my normal filesystem from a usb stick and 
> got the same results (kernel panic) and gave up.
>
> I'm back trying again. This time, the push is that I want the drive 
> trays for storage, but this is incidental to getting the machine to 
> boot off a usb stick.
>
>> I may be doing something similar to what Joe is trying to do: I'm 
>> running CentOS 8 from an (external) USB stick, with the four drive 
>> bays devoted to providing NFS (stripe accros mirrors; (tested) spare 
>> drive in a desk drawer. What's different is that I planned the system 
>> this way: I installed CentOS from a DVD with none of the disk drives 
>> installed, just the USB, and CentOS had no choice but to install on 
>> the USB.
>
> I was in the process of building a usb stick from scratch this way, 
> when I read your posting. I was heartened to know that in the right 
> circumstances, it works. In my case, I didn't expect any joy, as this 
> is the method I used to build the SATA disk that kernel panics booted 
> off the usb bus. The install doesn't know whether it's writing to a 
> usb stick or to a SATA drive, so I couldn't see how the files on the 
> different types of devices would be any different. As it turns out, 
> the usb stick I made this way kernel panics too.
>
> The install makes an optional syslinux boot usb stick (which can boot 
> your main install, in my case on a usb stick, if you choose not to 
> install the standard boot loader on your installed disk). So I had two 
> ways of booting the usb stick. The syslinux boot kernel panics too.
>
>> It boots fine. When I added the disk drives later, they were 
>> recognized, and I could configure them as I intended.
>
> I'm happy for you.
>
>> As to performance, once the OS gets loaded from USB, just about the 
>> only access to the USB is to write log files.  There's plenty of RAM 
>> to cache the OS file system, and to cache writes while they're 
>> waiting to get written.  In my setup, the rate of writes to the USB 
>> is far less than its bandwidth, so I'm having no performance trouble 
>> there.
>
> I'm glad to hear performance isn't a problem. I don't care about 
> performance. Current usb sticks are fast enough and the files are only 
> going to be read once and sit in cache (32G RAM) after that.
>
> This morning it occured to me that the difference in booting off a usb 
> stick and a SATA drive is that I'm using the distribution's generic 
> kernel, which likely won't have the usb drivers in it, but will load 
> the usb drivers as modules later. (I used to make custom kernels with 
> just the right drivers built into the kernel, but I gave up on this a 
> while ago. Now I want installs that boot anywhere I put them.)
>
> So I made the generic initrd (which I've never needed to use), using 
> the supplied script, and this time the kernel stops with
>
> can't mount /dev/sda1 on /mnt
>
> and drops me into a shell. This is a step forward.
>
> looking with ls, there are no /dev/sd*  in /dev
>
> I'm now going to mess around around with initrd files and as well 
> build a kernel with all the usb drivers built in.
>
> If anyone knows the solution to the current situation I'd be glad to 
> hear about it.
>
> Thanks Joe
>



More information about the TriLUG mailing list