Can someone answer a question that has been bothering me for a long time now....
Why do usb sticks require the need for an initrd in order to boot linux?
Can someone answer a question that has been bothering me for a long time now....
Why do usb sticks require the need for an initrd in order to boot linux?
-- *****************************************************************************
I would imagine that the reason is that the distro /on/ the stick includes the [v]fat driver as a module, rather than as a builtin. IMHO, that is the /only/ reason to use initrd (if your kernel internally supports the filesystem that your root fs is recorded in, you don't need initrd to boot).
-- Lew Pitcher Master Codewright & JOAT-in-training | Registered Linux User #112576
Initrd is a quick way of hiding details of a file system. Every file system like FAT, FAT32, EXT2, EXT3 would need a file system driver in the kernel to access the hundreds of files while Linux is booting. If instead it had to deal with opening a single file and having a specially crafted file system inside it containing all the hundreds of files Linux needs while booting, then the kernel won't have to deal with all the issues of many different file systems and hundreds of files spewn across that new file system and the file management to open all those files in turn. Instead, if it has an initrd, then all it needs to do open the single initrd file without managing it and it will always find all the files it needs within it without searching for it all over the drive. Initrd can be compressed - which makes it ideal for embedded systems.
That makes good sense, 7. But why am I unable to get a usb stick to boot without using an initrd?
-- *****************************************************************************
I'd be interested in that as well as I'm just starting out in the world of embedded linux. In theory, I believe that if you have all the filesystem and other drivers that you need compiled into the kernel, you should'nt need an initrd.
As an aside, is this an appropriate forum for me to be posting "newbie" questions?
Regards
Right - if you build a customized kernel with all the necessary drivers built in, you may be able to start without an initrd.
However, the kernel may grow so large that the boot cannot load it anymore - this depends on the bootstrap loader used.
Another reason for an initrd is that there may be utilities that have to run before the main file system can be used, An example is a LVM volume as the root file system, it needs to be started up.
Yes - as long as they are not obviously:
- a trolling attempt, or - homework.
-- Tauno Voipio tauno voipio (at) iki fi
You can.
I have an EEE and I boot 32Gb USB stick formatted as EXT2. I have installed Ubuntu into it.
All the directories in initrd (about 500 files and directories) are now in the root directory of the USB stick e.g. etc, bin, sbin, lib, usr and so on.
If you need more details, just post an additional request for the details.
Here's that request for additional details. Thanks 7!
-- *****************************************************************************
At this point your Linux should boot from the flash drive. The 500+ files that were in initrd are now on the flash drive as separate files. Plus about 4Gb of other stuff which is why you need a minimum 8Gb flash disk to do this.
(Old BIOSes don't like doing the boot from flash - get an Asus motherboard for about 50 pounds with Express Gate feature - that is bound to work very well with the bootable flash disk.)
Excuse me for my ignorance, but why would that be undesirable?
Regards Roger
EXT3 uses a journal to back out of transactions. So if data write went bad, it can back out - its good for data but bad for a USB stick and SDCard because each memory location can be written to between 100k and 1M - after that it begins to loose data. The journal is frequently written to. Hence its bad for USB stick and SDCard to use EXT3 (or NTFS). It will wear out your memory. SSDs on the other hand cycle the sectors transparently so that wear effect is less visible. USB Stick can use EXT2 OK (very fast) and FAT32 (slow).
[You can check out speed difference between EXT2 and FAT32 by installing Linux on a USB stick SDCard with initrd and extlinux boot loader for EXT2 and syslinux boot loader for FAT32. extlinux wins hands down. The syslinux method is described below. The extlinux method is similar - google for it.]Converting distros to boot from SD Cards and USB flash drives
-------------------------------------------------------------
Got me self an EEE but the EEE has no optical drives (no CDROMs). So I'm having to convert every install CD or liveCD into a bootable SD card or USB flash drive to boot on the EEE.
Without being able to convert a distro into a bootable USB flash /SD Card, that distro can't be easily loaded into netbook like EEE and stand to miss out on users installing it into netbooks.
So I would recommend all distro mainters look at their netbook boot strategy and offer something to boot their distros from USB flash and SD cards or miss out on users installing it into netbooks.
Having done a few conversions, a pattern emerges that works well for most syslinux / isolinux based distros.
Notes
----- A. You can skip steps 2 and 8 if you don't format your card again when you want to try out another distro. B. Step 5 is messy but quick. You can figure out and copy just the files needed. C. In step 6, editing the syslinux.cfg files can allow you to put more than 1 distro on the flash drive. But beware, many distros use default paths and names that can conflict.
This method tested and works for
Does not work for DVD distros with files greater than 2Gb size inside the .ISO file - - need a different install method using grub bootloader instead of syslinux (not covered here)
Does not work for .ISO files built with grub bootloader - need a different install method with grub boot loader instead of syslinux.
The latest EEE1000 has fast enough graphics for translucent
3D desktops.An easy way to do all this:
Install Ubuntu on EEE (compiz itself appears to be installed by default in the default install), then install compiz settings manager using Synaptic which allows compiz to be fully 'exercised'. And then do the following to get the 3D cube desktop working...
Go to General > Display Settings > Lighting and turned it off Enable Desktop Cube and then Desktop Cube > Transparent Cube and set the two opacity settings to 30% then Desktop Cube > Skydome and check the skydome check mark Enable Rotate Cube Enable Enhanced Zoom Desktop Right click the virtual workspaces panel and increase the number of colums to 8.And hey presto - 100% 3D translucent desktop with 8 screens!!!!!!!!!!
[Some shortcuts for the 3D screen ctrl + alt + left or right arrow to spin cube ctrl + alt + down arrow and then left or right arrow for a ring switcher super + E for yet another switcher super + mouse wheel scroll to zoom in and out of the 3D desktop. ]ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.