| 15 | |
| 16 | = GRUB2 = |
| 17 | == reduce grub entry == |
| 18 | * WindowsとLinuxのマルチブート -> Windowsを消してシングルブート化 |
| 19 | |
| 20 | 1. 元の状態 |
| 21 | * fdisk -lu /dev/sda |
| 22 | {{{ |
| 23 | Disk /dev/sda: 120.0 GB, 120034123776 bytes |
| 24 | 255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors |
| 25 | Units = sectors of 1 * 512 = 512 bytes |
| 26 | Sector size (logical/physical): 512 bytes / 512 bytes |
| 27 | I/O size (minimum/optimal): 512 bytes / 512 bytes |
| 28 | Disk identifier: 0x36ea3e05 |
| 29 | |
| 30 | Device Boot Start End Blocks Id System |
| 31 | /dev/sda1 63 524351 262144+ 82 Linux swap / Solaris |
| 32 | Partition 1 does not end on cylinder boundary. |
| 33 | /dev/sda2 524352 42467392 20971520+ 7 HPFS/NTFS |
| 34 | /dev/sda3 42467393 234441647 95987127+ 83 Linux |
| 35 | }}} |
| 36 | * OSのインストールは、Windows 7 -> Ubuntu 10.04の順 |
| 37 | * grep menuentry /boot/grub/grub.cfg | tr \" \' | cut -d\' -f2 |
| 38 | {{{ |
| 39 | Ubuntu, with Linux 2.6.32-33-generic |
| 40 | Ubuntu, with Linux 2.6.32-33-generic (recovery mode) |
| 41 | Ubuntu, with Linux 2.6.32-32-generic |
| 42 | Ubuntu, with Linux 2.6.32-32-generic (recovery mode) |
| 43 | Ubuntu, with Linux 2.6.32-31-generic |
| 44 | Ubuntu, with Linux 2.6.32-31-generic (recovery mode) |
| 45 | Memory test (memtest86+) |
| 46 | Memory test (memtest86+, serial console 115200) |
| 47 | Windows 7 (loader) (on /dev/sda2) |
| 48 | }}} |
| 49 | 1. NTFSパーティションの削除 |
| 50 | * root@Microknoppix:~# fdisk /dev/sdb |
| 51 | {{{ |
| 52 | |
| 53 | Device Boot Start End Blocks Id System |
| 54 | /dev/sdb1 1 33 262144+ 82 Linux swap / Solaris |
| 55 | Partition 1 does not end on cylinder boundary. |
| 56 | /dev/sdb2 * 33 2644 20971520+ 7 HPFS/NTFS |
| 57 | /dev/sdb3 2644 14594 95987127+ 83 Linux |
| 58 | |
| 59 | Command (m for help): d |
| 60 | Partition number (1-4): 2 |
| 61 | |
| 62 | Command (m for help): d |
| 63 | Partition number (1-4): 3 |
| 64 | |
| 65 | Command (m for help): n |
| 66 | Command action |
| 67 | e extended |
| 68 | p primary partition (1-4) |
| 69 | p |
| 70 | Partition number (1-4): 2 |
| 71 | First cylinder (33-14593, default 33): |
| 72 | Using default value 33 |
| 73 | Last cylinder, +cylinders or +size{K,M,G} (33-14593, default 14593): |
| 74 | Using default value 14593 |
| 75 | |
| 76 | Command (m for help): w |
| 77 | }}} |
| 78 | {{{ |
| 79 | Device Boot Start End Blocks Id System |
| 80 | /dev/sdb1 63 524351 262144+ 82 Linux swap / Solaris |
| 81 | Partition 1 does not end on cylinder boundary. |
| 82 | /dev/sdb2 524352 234436544 116956096+ 83 Linux |
| 83 | }}} |
| 84 | 1. backupしておいたdisk imageからLinuxパーティションを書き戻し |
| 85 | * root@Microknoppix:~# dd if=/media/sda/bb.sda bs=512 skip=42467393 of=/dev/sdb2 |
| 86 | {{{ |
| 87 | 191974255+0 records in |
| 88 | 191974255+0 records out |
| 89 | 98290818560 bytes (98 GB) copied, 3223.76 s, 30.5 MB/s |
| 90 | }}} |