Tinycore, Virtualbox, USB booting

上周买了一个ASUS的ASUS EeeBook X205TA,主要是看到价格便宜。
本本自带windows 8 with Bing,用起来可以,但是想到最近一直在看一些linux方面的书,就想装一个linux,不想装双系统,想装到U盘中启动。考虑到主要是学习用,没有必要装很多的东西,搜索了一下小的linux系统,TinyCore ,以前折腾过SLAX,DSL等都比这个还大;Tinycore可以做到10M一下,文档写得也可以,就用它了。
由于电脑没有光驱,那就先用虚拟机跑吧,下载了VirtualBox,开源的,很好,我一直在用。把TinyCore丢进虚拟机,很顺利的跑起来了。
其实要不TinyCore从U盘启动,官方的手册也提供了一个最直接的办法,推荐用core2usb,一个开源的工具,很直接;但是我在EeeBook上用的时候,一直说我的U盘非空,在我的Mac Air上和window 8 下面快速,深度格式化都没有用: 因为这个U盘原来是用来作为window 8的启动盘,是不是其前面的section有MBR系统导致问题呢,找到这篇文章
CMD+R,the windows flag key +R to running the command line;
Diskpart
list disk
select disk n
clean
是有个EFI分区,删除,还是没有用,挺奇怪的;反正是抱着要学习的态度,那就麻烦一点,手动来折腾一下。
进入Tinycore.官方手册还提供一个工具Tc-install,但是只在core pluse 中有,我下载的是core,需要手动装,先放一边,用最复杂的手动办法先来试一下。
手动安装因为有一定的难度,其实就更有通用性,对其余的linux等安装都有一定的参考意义。手动安装有三部分:

  1. Partition and formatting
    Need to check if BIOS support booting from USB;
    Formatting the USB to ext2 , there are some command in Linux used here:
    df -h ls -al /dev/sd* : check and confirm the dev file and mounting point state;
    fdisk -l fdisk /dev/sdb : use the n in disk to create one new partitions; a toggle the partition active the partition as bootable partition; w to save the change;
    mkfs.ext2 /dev/sdb: make the ext2 file system

  2. Files
    There are two files: vmlinuz and core.gz, actually, most of Linux liveCD distro have similar files. For corelinux, we can download the two file from the [WEB SITE]( http:// repo.tinycorelinux.net/4.x/x86/release/distribution_files/), but we can get the files from the ISO file in our Tinycore running on virtual box. There are the commands:
    cp -a copy the file and directory , -a means to copy the entire directory;
    mkdir /mnt/adb1 mount /dev/sdb1 /mnt/sdb1, we suppose that the ISO file store on you USB , and you formatting the USB with two partitions :sdb1 with one FAT, and sdb2 with ext2 file system, and the sdb1 can attached to windows or you os x system normally to store the ISO file.
    If there is any problem with this when you do in virtual box, just push out the USB in you host machine which maybe running on windows or os x, and then ,in the virtual box menu to select :Device => USB Device => your USB , you can re-do the last two steps if there is still any problems.
    cd /mnt/sdb1 you can check the ISO file in Tinycore, then:
    mount -o loop Core-current.iso /mnt/tmp
    cd /mnt/tmp
    cp -a boot /mnt/sdb2 , after you mount /dev/sdb2 /mnt/sdb2 if there is no such file and directory ,please check the step before.

  3. Bootloader
    Here, I use the Grub0.9. In Tinycore:
    tce-ab
    Follow the instruction to install the Grub0.9.
    sudo su
    **ensure you mount /dev/sdb2 /mnt/sdb2 **
    grub-install --root-directory=/mnt/sdb2 --no-floppy /dev/sdb This install the grub in the sdb MBR, and at the same time, build up directory /mnt/sdb2/boot/grub and cp the files there. After that , you should get message to show like this:

(hd0) /dev/sda
(hd1) /dev/sdb

Enter in grub interactive window by typing grub.
root (hd1,1)
setup (hd1)
Here, grub-install just build the device map , and map the SCSI device to HD device , and copy the file to /boot/grub ,actually , it does not write the MBR, need to use setup (hd1) to really write the MBR , need to take a note to the device in grub has not same name in Linux.

At last, we can edit the menu.lst or the grub.conf file under /boot/grub, if no existing , just create one.

你可能感兴趣的:(Tinycore, Virtualbox, USB booting)