|
|
楼主 |
发表于 2012-8-13 15:34:06
|
显示全部楼层
Booting Linux from the SDHC card in the Acer Aspire One:
If the kernel has the support for SD cards, at the inital bootup, have the initrd.img pre-loaded with the SD card modules using the initramfs-tools. Linux in ram will be able to see these devices and thereby boot from them.
The strategy
[a] Create new initrd-img files for booting with the SDHC modules pre-loaded for each installation.
Do the SDHC installations using USB to SDHC card readers.
[c] Obtain the unique UUID from each /boot/grub/menu.lst USB-SDHC adapter installation.
[d] Copy the new initrd-img and kernel files to the internal drive /boot directory.
[e] Add the new entries to the internal drive's /boot/grub/menu.lst inserting the correct device UUIDs, initrd.img.xxx.xxx name, and kernel file names.
I did TWO complete, tested, identical installations.
The first installation is to the internal SSD drive without the SDHC card installed.
I did manual partitioning with a 1GB swap partition and placed the MBR code at the beginning of the drive, such as /dev/sda, NOT /dev/sda1.
Reboot then go to then from the command line:
$cd /etc/initramfs-tools
Now as root we need to edit the modules file:
$gksu gedit modules
Add these each on one line (do not comment with #):
mmc_core
mmc_block
sdhci
sdhci-pci
Save the modules file.
Now at the command line type:
$sudo update-initramfs -u
This rewrites ( -u means updates and overwrites) the Linux initrd.img.xxx.xxx in the /boot directory.
The initrd.img now has the the modules preloaded so it can boot a SDHC device.
Now go and view the /boot/grub/menu.lst file and find the lines starting with "uuid" and "kernel". Note that the two uuids are the same hexadecimal values. We will return here to edit later.
The next installation is to the SDHC card using a USB-SDHC card adapter.
I used a USB to SDHC card reader and booted again using the USB-CD/DVD. Once in the Live CD installer, be careful and verify you have the correct device to install to. Use fdisk -l from the command line to verify the device assignment if needed. I did a manual partition with a 1 GB "swap" partition at the end of the install drive. The other swap partition on the internal drive was selected as not used. Like the first internal installation, I placed the MBR code at the beginning of the SDHC device-drive labeled /dev/sdb. (If Acer ever updates the BIOS for direct SDHC boot, these SDHC card installations will be ready for it.)
When complete, reboot from the USB-SDHC adpater device, hitting [F12] select boot devices, choose the USB-SDHC card adapter. Now test the installation.
If it works, go and view the /boot/grub/menu.lst file of this install and find the lines starting with "uuid" and "kernel". Note that the two uuids are the same hexadecimal values. Write this hexadecimal value down and or save it somewhere.
Shut down and insert SDHC card itself in the left slot of the Apsire One.
Boot from the internal 8 GB SSD installation.
Now as root we need to edit the /boot/grub/menu.lst file with a text editor or vi:
$gksu gedit /boot/grub/menu.lst
Scroll down to the entry of the default installation.
Here's my internal SSD installation (with my own labeling)
title Ubuntu 8.10, kernel 2.6.27-8-eeepc SDD - Internal
uuid 736f6f5a-28c8-4848-9b97-04342ca875b2
kernel /boot/vmlinuz-2.6.27-8-eeepc root=UUID=736f6f5a-28c8-4848-9b97-04342ca875b2 ro clocksource=hpet
initrd /boot/initrd.img-2.6.27-8-eeepc
quiet
Copy that entry and paste it below the first (internal SSD) entry.
Edit this one with the “uuids†of the SDHC device from the USB-SDHC adapter installation. In this case for my hardware: UUID=a555d64d-5991-410e-b725-d3f7e76d2fe8.
Your's will be different as each UUID is unique as Ubuntu Linux assigns them.
title Ubuntu 8.10, kernel 2.6.27-8-eeepc SDHC CARD
uuid 736f6f5a-28c8-4848-9b97-04342ca875b2
kernel /boot/vmlinuz-2.6.27-8-eeepc root=UUID=a555d64d-5991-410e-b725-d3f7e76d2fe8 ro clocksource=hpet
initrd /boot/initrd.img-2.6.27-8-eeepc
quiet
Save the /boot/grub/menu.lst, reboot and then select the new entry from the grub boot up menu and see it it works.
This is nuts but I purchased another Transcend 16 GB SDHC Mode 6 card and Installed a base Ubuntu 8.10 (from my USB stick install) to it for the Aspire One. Using the same technique with the additional modules update-initramfs as with the first install, I produced another new initrd-img-2.6.27-7-generic image with SDHC support.
This kernel vmlinuz-xxx.xxx.xx, and new initrd.img.xxx.xxx of this 2nd SDHC card installation WERE COPIED TO THE /boot DIRECTORY of the internal SSD installation.
I edited the /boot/grub/menu.lst with another entry and now can boot 2 different Linux installs on SDHC cards from the grub start up menu. (That is BOTH the left and right SD card slots of the Aspire One.)
Here's the ADDITIONAL /boot/grub/menu.lst entry to the INTERNAL DEFAULT SSD INSTALLAION.
title Ubuntu 8.10, kernel 2.6.27-7-generic SDHC Card Rt Slot
uuid 736f6f5a-28c8-4848-9b97-04342ca875b2
kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=0b217a58-efb6-4121-85cf-5daa5a473b53 ro
initrd /boot/initrd.img-2.6.27-7-generic
quiet
The Aspire One is booting the internal SSD (/dev/sda) install loading the /boot/grub/menu.lst from it as seen in the uuid line under the title line. The right slot SDHC has a different kernel and different UUID. The kernel and initrd lines define them.
Conclusions:
- Eeebuntu 2.0 is the finest Ubuntu Linux derivative I've tried on the Aspire One.
- Acer needs to add SDHC support like Asus did for the EeePCs BIOS, a direct boot is so much easier.
- The initramfs with grub technique to boot the non-BIOS supported SDHC works on the Aspire one.
- Boot up time is slightly longer than just running the SSD install, since the initial boot information is being read twice off two devices. Write speed of the SDHC cards is close to the slow, but usable SSD installation. Read speads I feel no difference.
- For owners of Aspire One with Window's pre-loads, this technique if carefully done, could preserve the Windows setup if the internal drive is partitioned with a small /boot partition. Gparted would work well at resizing and creation of a small 50-100 MB /boot partition. Upon a USB-adapter card install, the /boot partition could be specified on the internal drive. Ubuntu is smart enough to add the Windows chain loader entry into the grub menu.
- Plan on spending a few hours if you do a SD card boot installation.
- Solid state drive F.U.D.? I feel these solid state wonders will outlive the life of these computers. High ESD and physical abuse, such as bending, is more of a threat to the longevity of these SD cards than using one for an operating system installation. Once roomy NAND Flash drives reach the price and performance levels of today's hard drives, consumers will see solid state is vastly superior. No moving parts, high vibration and shock resistance. Flash drives work in greater temperature extremes, work over 10,000 ft. and are close to surpassing hard drive IO speed on the high end models.
|
|