ThinkPad x61 - SSD換装(2)

[2] Linuxの修復

Linuxも修復した。

(1) CentOS6.4 netinstall CDでブート、rescue installed system

(2) shellを実行し、下記のようにgrubを修復する

# chroot /mnt/sysimage

# grub-install /dev/sda3  <<<これは、/bootが/dev/sda3にあるから。

(3) mbr部分を抽出

# mount -t vfat /dev/sda6 /mnt/win

# dd if=/dev/sda3 of=/mnt/win/centos-141104.pbr bs=512 count=1

リブートしてWindows 7のブートメニューに追加する

(4) Command promptでLinux bootloaderを追加する

copy f:\centos-141109.pbr c:\

bcdedit /create /d "CentOS6.4(N)" /application bootsector

bcdedit /set {------------} device partition=C:

bcdedit /set {------------} path \centos-141109.pbr

bcdedit /displayorder {-------------} /addlast

リブートしてCentOS6.4(N)を選択。

SELinux target policy relabelling is required. と出てなにやら再構築?が

発生(添付)

リブートがかかって起動完了。WinのMBRが書き換わっていないか心配だったが、無事だった。

[root@lithium ~]# mount

/dev/mapper/vg_lithium-LogVol00 on / type ext4 (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

devpts on /dev/pts type devpts (rw,gid=5,mode=620)

tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")

/dev/sda3 on /boot type ext4 (rw)

none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

[root@lithium ~]# fdisk -l

Disk /dev/sda: 256.1 GB, 256060514304 bytes

240 heads, 63 sectors/track, 33076 cylinders

Units = cylinders of 15120 * 512 = 7741440 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x2c86c239

Device Boot Start End Blocks Id System

/dev/sda1 * 1 8 60448+ 7 HPFS/NTFS

/dev/sda2 9 12824 96888960 7 HPFS/NTFS

/dev/sda3 12825 12852 211680 83 Linux

/dev/sda4 12853 33076 152893440 f W95 Ext'd (LBA)

/dev/sda5 12853 13962 8391568+ 82 Linux swap / Solaris

/dev/sda6 13963 14650 5201248+ b W95 FAT32

/dev/sda7 14651 33076 139300528+ 8e Linux LVM

Disk /dev/mapper/vg_lithium-LogVol00: 142.6 GB, 142639890432 bytes

255 heads, 63 sectors/track, 17341 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x0000000