トリプルブート †
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | Format | Size | MacOSX(GPT) での見え方 | Linux(GPT) での見え方 | WinXP(MBR) での見え方 | 備考 |
| 1 | FAT32 | 200M | - | EFI | ||
| 2 | HFS+ | 90G | Macintosh HD | /dev/sda2 | MacOSX | |
| 3 | ext2 → FAT32 | 5G | share | /dev/sda3 (/share) | Gドライブ | 共有領域 |
| 4 | NTFS | 30G | - | /dev/sda4 | Cドライブ | WindowsXP |
| 5 | Linux swap | 1G | swap | Linux | ||
| 6 | HFS+ | 200M | LinuxBoot | /dev/sda6 (/boot) | ||
| 7 | Reiserfs | 21G | /dev/sda7 (rootfs) | |||
# diskutil resizeVolume disk0s2 90G \
Linux share 5G "MS-DOS FAT32" winxp 30G \
Swap swap 1G HFS+ LinuxBoot 200M Linux Linux 20G
# gpt -r show /dev/disk0
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B ← EFI
409640 311909984 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC ← MacOSX
312319624 262151
312581775 32 Sec GPT table
312581807 1 Sec GPT header
# gpt -r show /dev/disk0
gpt show: /dev/disk0: Suspicious MBR at sector 0
start size index contents
0 1 MBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
409640 188743680 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
189153320 262144
189415464 10485760 3 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
199901224 62914560 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
262815784 2097152 5 GPT part - 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F
264912936 409600 6 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
265322536 47259232 7 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
312581768 7
312581775 32 Sec GPT table
312581807 1 Sec GPT header

$ diskutil eraseVolume HFS+ LinuxBoot /dev/disk0s6
$ cd /Volumes/LinuxBoot $ sudo bless --folder . --file e.efi --labelfile linux.volicon
# force chooser to textmenu chooser=simple legacy-free default=initrd delay=0 #prompt image=vmlinuz-2.6.16.5-imac label=linux append="video=imacfb:i17 acpi=force irqpoll root=/dev/sda7 libata.atapi_enabled=1" image=vmlinuz-2.6.16.5-imac label=initrd initrd=initrd-parted.gz append="video=imacfb:i17 acpi=force irqpoll root=/dev/ram0 rw libata.atapi_enabled=1"

# mkfs.reiserfs /dev/sda7 # mkswap /dev/sda5
# mount -t reiserfs /dev/sda7 /mnt # mkdir /mnt/boot # mount -t hfsplus /dev/sda6 /mnt/boot
# mkdir /osx # mount -t hfsplus /dev/sda2 /osx # cp /osx/XXXXXX/ubuntu-ja-5.10-live-i386-20051024.iso /mnt # cp /osx/XXXXXX/ubuntu-ja-overwrite-20060314.tgz /mnt # cp /osx/XXXXXX/kernel-image-2.6.16.5-imac_20060414b_i386.deb /mnt # umount /osx
# mkdir /iso # mount -t iso9660 -o loop /mnt/ubuntu-ja-5.10-live-i386-20051024.iso /iso # extract_compressed_fs /iso/casper/filesystem.cloop > /mnt/filesystem.loop # umount /iso # rm /mnt/ubuntu-ja-5.10-live-i386-20051024.iso
# mount -t ext2 -o loop /mnt/filesystem.loop /iso # cp -a /iso/* /mnt/ # umount /iso # rm /mnt/filesystem.loop
# cd /mnt # chroot . sh-3.00# tar vxzpf ubuntu-ja-overwrite-20060314.tgz sh-3.00# dpkg -i kernel-image-2.6.16.5-imac_20060414b_i386.deb sh-3.00# rm ubuntu-ja-overwrite-20060314.tgz sh-3.00# rm kernel-image-2.6.16.5-imac_20060414b_i386.deb
# passwd ubuntu Enter new UNIX password: password Retype new UNIX password: password passwd: passwd updated successfully
# /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 /dev/sda7 / reiserfs defaults 0 1 /dev/sda5 none swap sw 0 0 /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0 /dev/sda6 /boot hfsplus defaults 0 0
# force chooser to textmenu chooser=simple legacy-free default=linux #default=initrd delay=0 #prompt …省略…
sh-3.00# exit # cd / # umount /mnt/boot # umount /mnt # reboot
$ sudo su
# mkfs.vfat /dev/sda3 # mkdir /share
/dev/sda3 /share vfat defaults 0 0
root@ubuntu:/# mount -a
root@ubuntu:/# df
Filesystem 1K-ブロック 使用 使用可 使用% マウント位置
/dev/sda7 23628840 1405964 22222876 6% /
tmpfs 515660 4 515656 1% /dev/shm
/dev/sda6 204800 15740 189060 8% /boot
/dev/sda3 5232640 24 5232616 1% /share
tmpfs 10240 2656 7584 26% /dev
root@ubuntu:/# fdisk -lu /dev/sda
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = セクタ数 of 1 * 512 = 512 bytes
デバイス Boot Start End Blocks Id System
/dev/sda1 1 409639 204819+ ee EFI GPT
Partition 1 does not end on cylinder boundary.
/dev/sda2 409640 189153319 94371840 af 不明
Partition 2 does not end on cylinder boundary.
/dev/sda3 189415464 199901223 5242880 b W95 FAT32
Partition 3 does not end on cylinder boundary.
/dev/sda4 * 199901224 262815783 31457280 7 HPFS/NTFS
Partition 4 does not end on cylinder boundary.
root@ubuntu:/# dd if=/dev/sda of=/boot/MBR.bak bs=512 count=1
#comment