Version 7 (modified by mitty, 13 years ago) (diff) |
---|
- USBブート推進協議会
- OS Circular
OS Circular is a framework of Internet Disk Image Distributor for anonymous OSes.
- Minimal CD Image内のlinux, initrd.gzと http://jp.archive.ubuntu.com/ubuntu/dists/maverick/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/ などにあるlinux, initrd.gzは同じ
- http://jp.archive.ubuntu.com/ubuntu/dists/maverick/main/installer-amd64/current/images/netboot/mini.iso > linux, initrd.gz
- http://jp.archive.ubuntu.com/ubuntu/dists/maverick/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux
- http://jp.archive.ubuntu.com/ubuntu/dists/maverick/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz
- initrd.gzに関しては中身は同じ
- pxelinux.cfg等はパスが異なる
GRUB2
reduce grub entry
- WindowsとLinuxのマルチブート -> Windowsを消してシングルブート化
- 元の状態
- fdisk -lu /dev/sda
Disk /dev/sda: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x36ea3e05 Device Boot Start End Blocks Id System /dev/sda1 63 524351 262144+ 82 Linux swap / Solaris Partition 1 does not end on cylinder boundary. /dev/sda2 524352 42467392 20971520+ 7 HPFS/NTFS /dev/sda3 42467393 234441647 95987127+ 83 Linux
- OSのインストールは、Windows 7 -> Ubuntu 10.04の順
- grep menuentry /boot/grub/grub.cfg | tr \" \' | cut -d\' -f2
Ubuntu, with Linux 2.6.32-33-generic Ubuntu, with Linux 2.6.32-33-generic (recovery mode) Ubuntu, with Linux 2.6.32-32-generic Ubuntu, with Linux 2.6.32-32-generic (recovery mode) Ubuntu, with Linux 2.6.32-31-generic Ubuntu, with Linux 2.6.32-31-generic (recovery mode) Memory test (memtest86+) Memory test (memtest86+, serial console 115200) Windows 7 (loader) (on /dev/sda2)
- fdisk -lu /dev/sda
- NTFSパーティションの削除
- root@Microknoppix:~# fdisk /dev/sdb
Device Boot Start End Blocks Id System /dev/sdb1 1 33 262144+ 82 Linux swap / Solaris Partition 1 does not end on cylinder boundary. /dev/sdb2 * 33 2644 20971520+ 7 HPFS/NTFS /dev/sdb3 2644 14594 95987127+ 83 Linux Command (m for help): d Partition number (1-4): 2 Command (m for help): d Partition number (1-4): 3 Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 2 First cylinder (33-14593, default 33): Using default value 33 Last cylinder, +cylinders or +size{K,M,G} (33-14593, default 14593): Using default value 14593 Command (m for help): w
Device Boot Start End Blocks Id System /dev/sdb1 63 524351 262144+ 82 Linux swap / Solaris Partition 1 does not end on cylinder boundary. /dev/sdb2 524352 234436544 116956096+ 83 Linux
- root@Microknoppix:~# fdisk /dev/sdb
- backupしておいたdisk imageからLinuxパーティションを書き戻し
- root@Microknoppix:~# dd if=/media/sda/bb.sda bs=512 skip=42467393 of=/dev/sdb2
191974255+0 records in 191974255+0 records out 98290818560 bytes (98 GB) copied, 3223.76 s, 30.5 MB/s
- root@Microknoppix:~# dd if=/media/sda/bb.sda bs=512 skip=42467393 of=/dev/sdb2
- 正常には起動しなくなるため、grubから手動でUbuntuを起動する
- 以下の様に、grub consoleに落ちる
grub rescue> set prefix=(hd0,3)/boot/grub root=(hd0,3)
- Ubuntu で grub rescue -> grub-install を実行して grub を修復 - 新芽の手、ほんとの手
- 上記サイトに倣い、以下のようにしてGRUBメニューを起動する
set prefix=(hd0,2)/boot/grub insmod (hd0,2)/boot/grub/normal.mod normal
- これで、以前のGRUB起動メニューが表示される
- 通常通り起動
- 以下の様に、grub consoleに落ちる
- grubを修復する
- sudo grub-install /dev/sda
Installation finished. No error reported.
- sudo update-grub
Generating grub.cfg ... Found linux image: /boot/vmlinuz-2.6.32-33-generic Found initrd image: /boot/initrd.img-2.6.32-33-generic Found linux image: /boot/vmlinuz-2.6.32-32-generic Found initrd image: /boot/initrd.img-2.6.32-32-generic Found linux image: /boot/vmlinuz-2.6.32-31-generic Found initrd image: /boot/initrd.img-2.6.32-31-generic Found memtest86+ image: /boot/memtest86+.bin done
- sudo grub-install /dev/sda
- GRUBメニュー修復完了
- grep menuentry /boot/grub/grub.cfg | tr \" \' | cut -d\' -f2
Ubuntu, with Linux 2.6.32-33-generic Ubuntu, with Linux 2.6.32-33-generic (recovery mode) Ubuntu, with Linux 2.6.32-32-generic Ubuntu, with Linux 2.6.32-32-generic (recovery mode) Ubuntu, with Linux 2.6.32-31-generic Ubuntu, with Linux 2.6.32-31-generic (recovery mode) Memory test (memtest86+) Memory test (memtest86+, serial console 115200)
- grep menuentry /boot/grub/grub.cfg | tr \" \' | cut -d\' -f2
- 適宜、Filesystemの伸張をする
- df -h /
Filesystem Size Used Avail Use% Mounted on /dev/sda2 93G 33G 56G 37% /
- sudo resize2fs /dev/sda2
resize2fs 1.41.11 (14-Mar-2010) Filesystem at /dev/sda2 is mounted on /; on-line resizing required old desc_blocks = 6, new_desc_blocks = 7 Performing an on-line resize of /dev/sda2 to 29239024 (4k) blocks. The filesystem on /dev/sda2 is now 29239024 blocks long.
- df -h /
Filesystem Size Used Avail Use% Mounted on /dev/sda2 110G 33G 72G 32% /
- df -h /