[原创]U盘启动能保存数据的Hiweed
发表于 : 2007-04-22 9:26
U盘启动能保存数据的Hiweed
关键词:U盘 优盘 ubuntu hiweed 启动 persistent
一直想有个U盘能启动ubuntu,能保存自己的设置数据,随身携带到别人的计算机上usb启动就有了自己熟悉的环境界面。为了实现这个目的,查看了不少人的贴子(感谢huahua、gnix_oag、ptptpt有多少个pt?),自己实验了一下,现在阶段性的报告如下。
关于U盘的选择
容量我用了1G的,因为Hiweed大约占700M,自己的设定数据占300M。自然2G更多自己的数据空间就更大。我试用了铼德的Ridata/KingMax蓝色高速超棒/sandisk的miniSD接转换器为标准SD+《微电脑世界》赠送的6合一读卡器,都可的以启动成功。KingMax的速度应该是最快的,可是我也没有明显感觉。所以3M写6M读应该也是可以的。也没有必要是启动型的U盘,见下文。
U盘分区准备(请确认你的U盘是否是/dev/sdb,操作请确认U盘处于umount状态)
ubuntu@ubuntu:~$ sudo fdisk /dev/sdb
Command (m for help): p
Disk /dev/sdb: 1027 MB, 1027604480 bytes
255 heads, 63 sectors/track, 124 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 86 690763+ 6 FAT16
/dev/sdb2 87 124 305235 83 Linux
Command (m for help): d
Partition number (1-4): 1
Command (m for help): d
Selected partition 2
#删除原有的分区,为了重新分区
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-124, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-124, default 124): +700M
#建立新分区700M,Hiweed够了,其他的ubuntu也许需要更多空间
Command (m for help): a
Partition number (1-4): 1
#设为启动分区
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 6
Changed system type of partition 1 to 6 (FAT16)
#将分区设为FAT16
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (87-124, default 87):
Using default value 87
Last cylinder or +size or +sizeM or +sizeK (87-124, default 124):
Using default value 124
#建立第二的分区,用于保存设定数据
Command (m for help): p
Disk /dev/sdb: 1027 MB, 1027604480 bytes
255 heads, 63 sectors/track, 124 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 86 690763+ 6 FAT16
/dev/sdb2 87 124 305235 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
ubuntu@ubuntu:~$
#重新插拔一下U盘,完成分区准备建立文件系统
ubuntu@ubuntu:~$ mkfs.vfat -F 32 -n Hiweed /dev/sdb1
#-n volume-name
mkfs.vfat 2.11 (12 Mar 2005)
ubuntu@ubuntu:~$ mkfs.ext2 -b 4096 -L casper-rw /dev/sdb2
#-L Set the volume label for the filesystem。因为ubuntu的persisitent模式需
#要定义这个volume name为casper-rw
mke2fs 1.38 (30-Jun-2005)
Filesystem label=casper-rw
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
76320 inodes, 76308 blocks
3815 blocks (5.00%) reserved for the super user
First data block=0
3 block groups
32768 blocks per group, 32768 fragments per group
25440 inodes per group
Superblock backups stored on blocks:
32768
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
U盘数据准备
完全依照http://www.hiweed.com/node/96 只不过硬盘换成U盘。
下载 http://ftp.ubuntu.org.cn/gnix_oag/hd_boot_liveCD.rar
#--username=ubuntu --password=ubuntuftp
解压后拷贝到/dev/sdb1上
ubuntu@ubuntu:~$ ls /media/Hiweed/
boot
ubuntu@ubuntu:~$ ls /media/Hiweed/boot/
grub initrd.gz vmlinuz
ubuntu@ubuntu:~$ ls /media/Hiweed/boot/grub/
bj2008.xpm.gz menu.lst
修改 \boot\grub\menu.lst 文件,将
title Start or install Ubuntu
kernel (hd0,0)/boot/vmlinuz boot=casper ramdisk_size=1048576 root=/dev/ram rw quiet splash debian-installer/locale=zh_CN
修改为
title Start Hiweed
kernel (hd0,0)/boot/vmlinuz boot=casper persistent ramdisk_size=1048576 root=/dev/ram rw quiet splash
#persistent 使用casper-rw的标志
然后保存文件。
将 Hiweed GNU/Linux Desktop 的 ISO 文件中 casper 目录解压放在/dev/sdb1分区的根目录。
ubuntu@ubuntu:~$ ls /media/Hiweed/
boot casper
如何使U盘启动
这个曾经困扰了我。试用了syslinux,未果。最后还是使用了grub,这个我熟悉的东东。
sudo apt-get install mbr
在u盘上建立mbr:sudo install-mbr /dev/sdb
然后grub
>root (hd0,0)
为了确认是否是正确的U盘可以
>cat (hd0,0)/boot/grub/menu.lst
然后在mbr上安装grub
>setup (hd0)
#这一步是需要stage等文件的。在安装好的ubuntu/boot/grub/下面有这些文件拷贝到U盘的/boot/grub/下,再次执行setup(hd0)成功。
结果:U盘可以使用Hiweed,liveCD启动,并保存数据。下一步需要研究filesystem.squashfs,启动引导的initrd.gz vmlinuz,按需定制要启动的ubuntu。保存数据的形式为 gnix_oag的ubuntu.fs形式,为Fat区上的一个文件这样就不用再创建casper-rw这个分区了。Hiweed有了新版本1.2? 也想重新制作U盘尝试。
另:国外是有人卖U盘启动的ubuntu的。像这种设定了启动,能引导工作保存数据的U盘如果在淘宝上卖,会有人买吗?容量为1G-2G,价格在U盘价格上添加一点服务费。
计算机的U盘启动(转载)
我U盘启动没碰见特别的设置,只是可能需要换换usb口。
BIOS USB booting tips and tricks
The system BIOS can be complicated to someone who is not yet familiar with all of the settings. Here are a few tips to increase your chances of USB Linux system boot success. If the flash memory stick fails to boot, go back into the system BIOS and try changing some of the following settings (taking note to the changes made).
BIOS setting tips:
Switch on or off USB keyboard support
Turn off Fast Boot
Disable USB 2.0 support (last resort, this will default to USB 1.1)
General tips:
Unplug USB hubs and extensions (these may draw from the current needed to wake your USB device)
Try using a different USB port. (some frontal ports may not be fully supportive)
Unplug additional USB devices. (I’ve seen something as simple as an IPod halt a system boot)
Sometimes a USB drive may go undetected at startup. If your drive has an LED, ensure that it either flashes or remains solid during system post. If the drive does not respond, remove the drive, then power the system completely down for 15 seconds, reinsert the drive and try again.
Some laptops using a PCMCIA slot may have troubles booting. You may have to tell Linux to ignore PCMCIA during boot. You can do this in the syslinux.cfg file by simply adding “nopcmcia” to the default boot options or by using a cheatcode before boot.
Also, be sure to check out the USB BIOS boot options section.
USB BIOS boot options
The following list of USB BIOS boot options have been thoroughly tested with various Linux USB installs. There may be others but this is meant to be a simple checklist to familiarize you with the boot options and which ones to use. Check back often as we will be adding new information to this list over time.
BIOS Boot Options:
1.USB-HDD ” Preferred boot method”
2.USB-ZIP “May or may not work”
3.USB-FDD “Unsupported”
Summary:
Generally speaking, if your system BIOS supports the USB-HDD boot option, it should boot Linux from a large capacity USB flash drive. (a BIOS that supports USB-HDD automatically detects the geometry of the USB Flash drive)
The USB-ZIP option is typically used on older systems that do not support USB-HDD boot. Using this boot option might require modifying the drive geometry to match how the BIOS has been hard-coded to see the device.
Exception: The USB-ZIP boot option may allow you to boot larger capacity flash drives without drive geometry modification, if your BIOS also lists the flash drive as a selectable hard drive under boot priority. (Typical of the Award-Phoenix BIOS)
Tips:
If your BIOS lists the USB memory stick as a hard drive, you should select it as the 1st boot device.
You should always remove other USB boot options from the boot priority list when attempting to boot from USB-ZIP or USB-HDD to avoid conflicting startup Cues.
The file-system used may also affect the BIOS’s ability to detect and boot the drive. If a Fat file-system doesn’t work, try Fat32.
Be sure to keep an eye out for BIOS updates from your board manufaturer.
Through experience, we have found that most “recent” Award/Phoenix and AMI BIOS’s can generally support USB boot.
关键词:U盘 优盘 ubuntu hiweed 启动 persistent
一直想有个U盘能启动ubuntu,能保存自己的设置数据,随身携带到别人的计算机上usb启动就有了自己熟悉的环境界面。为了实现这个目的,查看了不少人的贴子(感谢huahua、gnix_oag、ptptpt有多少个pt?),自己实验了一下,现在阶段性的报告如下。
关于U盘的选择
容量我用了1G的,因为Hiweed大约占700M,自己的设定数据占300M。自然2G更多自己的数据空间就更大。我试用了铼德的Ridata/KingMax蓝色高速超棒/sandisk的miniSD接转换器为标准SD+《微电脑世界》赠送的6合一读卡器,都可的以启动成功。KingMax的速度应该是最快的,可是我也没有明显感觉。所以3M写6M读应该也是可以的。也没有必要是启动型的U盘,见下文。
U盘分区准备(请确认你的U盘是否是/dev/sdb,操作请确认U盘处于umount状态)
ubuntu@ubuntu:~$ sudo fdisk /dev/sdb
Command (m for help): p
Disk /dev/sdb: 1027 MB, 1027604480 bytes
255 heads, 63 sectors/track, 124 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 86 690763+ 6 FAT16
/dev/sdb2 87 124 305235 83 Linux
Command (m for help): d
Partition number (1-4): 1
Command (m for help): d
Selected partition 2
#删除原有的分区,为了重新分区
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-124, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-124, default 124): +700M
#建立新分区700M,Hiweed够了,其他的ubuntu也许需要更多空间
Command (m for help): a
Partition number (1-4): 1
#设为启动分区
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 6
Changed system type of partition 1 to 6 (FAT16)
#将分区设为FAT16
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (87-124, default 87):
Using default value 87
Last cylinder or +size or +sizeM or +sizeK (87-124, default 124):
Using default value 124
#建立第二的分区,用于保存设定数据
Command (m for help): p
Disk /dev/sdb: 1027 MB, 1027604480 bytes
255 heads, 63 sectors/track, 124 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 86 690763+ 6 FAT16
/dev/sdb2 87 124 305235 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
ubuntu@ubuntu:~$
#重新插拔一下U盘,完成分区准备建立文件系统
ubuntu@ubuntu:~$ mkfs.vfat -F 32 -n Hiweed /dev/sdb1
#-n volume-name
mkfs.vfat 2.11 (12 Mar 2005)
ubuntu@ubuntu:~$ mkfs.ext2 -b 4096 -L casper-rw /dev/sdb2
#-L Set the volume label for the filesystem。因为ubuntu的persisitent模式需
#要定义这个volume name为casper-rw
mke2fs 1.38 (30-Jun-2005)
Filesystem label=casper-rw
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
76320 inodes, 76308 blocks
3815 blocks (5.00%) reserved for the super user
First data block=0
3 block groups
32768 blocks per group, 32768 fragments per group
25440 inodes per group
Superblock backups stored on blocks:
32768
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
U盘数据准备
完全依照http://www.hiweed.com/node/96 只不过硬盘换成U盘。
下载 http://ftp.ubuntu.org.cn/gnix_oag/hd_boot_liveCD.rar
#--username=ubuntu --password=ubuntuftp
解压后拷贝到/dev/sdb1上
ubuntu@ubuntu:~$ ls /media/Hiweed/
boot
ubuntu@ubuntu:~$ ls /media/Hiweed/boot/
grub initrd.gz vmlinuz
ubuntu@ubuntu:~$ ls /media/Hiweed/boot/grub/
bj2008.xpm.gz menu.lst
修改 \boot\grub\menu.lst 文件,将
title Start or install Ubuntu
kernel (hd0,0)/boot/vmlinuz boot=casper ramdisk_size=1048576 root=/dev/ram rw quiet splash debian-installer/locale=zh_CN
修改为
title Start Hiweed
kernel (hd0,0)/boot/vmlinuz boot=casper persistent ramdisk_size=1048576 root=/dev/ram rw quiet splash
#persistent 使用casper-rw的标志
然后保存文件。
将 Hiweed GNU/Linux Desktop 的 ISO 文件中 casper 目录解压放在/dev/sdb1分区的根目录。
ubuntu@ubuntu:~$ ls /media/Hiweed/
boot casper
如何使U盘启动
这个曾经困扰了我。试用了syslinux,未果。最后还是使用了grub,这个我熟悉的东东。
sudo apt-get install mbr
在u盘上建立mbr:sudo install-mbr /dev/sdb
然后grub
>root (hd0,0)
为了确认是否是正确的U盘可以
>cat (hd0,0)/boot/grub/menu.lst
然后在mbr上安装grub
>setup (hd0)
#这一步是需要stage等文件的。在安装好的ubuntu/boot/grub/下面有这些文件拷贝到U盘的/boot/grub/下,再次执行setup(hd0)成功。
结果:U盘可以使用Hiweed,liveCD启动,并保存数据。下一步需要研究filesystem.squashfs,启动引导的initrd.gz vmlinuz,按需定制要启动的ubuntu。保存数据的形式为 gnix_oag的ubuntu.fs形式,为Fat区上的一个文件这样就不用再创建casper-rw这个分区了。Hiweed有了新版本1.2? 也想重新制作U盘尝试。
另:国外是有人卖U盘启动的ubuntu的。像这种设定了启动,能引导工作保存数据的U盘如果在淘宝上卖,会有人买吗?容量为1G-2G,价格在U盘价格上添加一点服务费。
计算机的U盘启动(转载)
我U盘启动没碰见特别的设置,只是可能需要换换usb口。
BIOS USB booting tips and tricks
The system BIOS can be complicated to someone who is not yet familiar with all of the settings. Here are a few tips to increase your chances of USB Linux system boot success. If the flash memory stick fails to boot, go back into the system BIOS and try changing some of the following settings (taking note to the changes made).
BIOS setting tips:
Switch on or off USB keyboard support
Turn off Fast Boot
Disable USB 2.0 support (last resort, this will default to USB 1.1)
General tips:
Unplug USB hubs and extensions (these may draw from the current needed to wake your USB device)
Try using a different USB port. (some frontal ports may not be fully supportive)
Unplug additional USB devices. (I’ve seen something as simple as an IPod halt a system boot)
Sometimes a USB drive may go undetected at startup. If your drive has an LED, ensure that it either flashes or remains solid during system post. If the drive does not respond, remove the drive, then power the system completely down for 15 seconds, reinsert the drive and try again.
Some laptops using a PCMCIA slot may have troubles booting. You may have to tell Linux to ignore PCMCIA during boot. You can do this in the syslinux.cfg file by simply adding “nopcmcia” to the default boot options or by using a cheatcode before boot.
Also, be sure to check out the USB BIOS boot options section.
USB BIOS boot options
The following list of USB BIOS boot options have been thoroughly tested with various Linux USB installs. There may be others but this is meant to be a simple checklist to familiarize you with the boot options and which ones to use. Check back often as we will be adding new information to this list over time.
BIOS Boot Options:
1.USB-HDD ” Preferred boot method”
2.USB-ZIP “May or may not work”
3.USB-FDD “Unsupported”
Summary:
Generally speaking, if your system BIOS supports the USB-HDD boot option, it should boot Linux from a large capacity USB flash drive. (a BIOS that supports USB-HDD automatically detects the geometry of the USB Flash drive)
The USB-ZIP option is typically used on older systems that do not support USB-HDD boot. Using this boot option might require modifying the drive geometry to match how the BIOS has been hard-coded to see the device.
Exception: The USB-ZIP boot option may allow you to boot larger capacity flash drives without drive geometry modification, if your BIOS also lists the flash drive as a selectable hard drive under boot priority. (Typical of the Award-Phoenix BIOS)
Tips:
If your BIOS lists the USB memory stick as a hard drive, you should select it as the 1st boot device.
You should always remove other USB boot options from the boot priority list when attempting to boot from USB-ZIP or USB-HDD to avoid conflicting startup Cues.
The file-system used may also affect the BIOS’s ability to detect and boot the drive. If a Fat file-system doesn’t work, try Fat32.
Be sure to keep an eye out for BIOS updates from your board manufaturer.
Through experience, we have found that most “recent” Award/Phoenix and AMI BIOS’s can generally support USB boot.