View previous topic :: View next topic |
Author |
Message |
kilburna Tux's lil' helper
Joined: 20 Sep 2004 Posts: 107
|
Posted: Sun Jan 25, 2015 8:32 am Post subject: grub2-install failing after RAID 1 server clone [SOLVED] |
|
|
Hi
I cloned a RAID 1 server with GPT partitions. The 2 disks has 4 partitions, but only the sda1 and sdb1 are not part of the RAID 1
I use the following procedure
Quote: | 1. mdadm /dev/md0 --fail /dev/sdb2 --remove /dev/sdb2
mdadm /dev/md1 --fail /dev/sdb3 --remove /dev/sdb3
mdadm /dev/md2 --fail /dev/sdb4 --remove /dev/sdb4
2. Replace sdb drive with the same size drive.
3. sgdisk --replicate=/dev/sdb /dev/sda
sgdisk -G /dev/sdb
4. mdadm /dev/md0 --add /dev/sdb2
mdadm /dev/md1 --add /dev/sdb3
mdadm /dev/md2 --add /dev/sdb4
5. mdadm /dev/md0 --fail /dev/sda2 --remove /dev/sda2
mdadm /dev/md1 --fail /dev/sda3 --remove /dev/sda3
mdadm /dev/md2 --fail /dev/sda4 --remove /dev/sda4
6. sgdisk --replicate=/dev/sda /dev/sdb
sgdisk -G /dev/sda
7. mdadm /dev/md0 --add /dev/sda2
mdadm /dev/md1 --add /dev/sda3
mdadm /dev/md2 --add /dev/sda4
8. grub2-install /dev/sda
grub2-install /dev/sdb
|
All goes well until Step 8 when I get
Code: | CBox grub # grub2-install /dev/sda
Installing for i386-pc platform.
grub2-install: error: disk `mduuid/4e8715bf5c9a685fcb201669f728008a' not found.
|
Quote: | CBox grub # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 2M 0 part
├─sda2 8:2 0 128M 0 part
│ └─md0 9:0 0 128M 0 raid1 /boot
├─sda3 8:3 0 3.8G 0 part
│ └─md1 9:1 0 3.8G 0 raid1 [SWAP]
└─sda4 8:4 0 927.6G 0 part
└─md2 9:2 0 927.6G 0 raid1 /
sdb 8:16 0 931.5G 0 disk
├─sdb1 8:17 0 2M 0 part
├─sdb2 8:18 0 128M 0 part
│ └─md0 9:0 0 128M 0 raid1 /boot
├─sdb3 8:19 0 3.8G 0 part
│ └─md1 9:1 0 3.8G 0 raid1 [SWAP]
└─sdb4 8:20 0 927.6G 0 part
└─md2 9:2 0 927.6G 0 raid1 /
|
Quote: | CBox grub # blkid
/dev/md0: UUID="165c868b-0d4f-43f3-958f-9ffe214438ba" TYPE="ext2"
/dev/md2: UUID="46f86148-c45e-4b15-902e-862241bc3ddd" TYPE="ext4"
/dev/md1: UUID="c06b75fd-842f-4ef3-a9f5-175d102c0106" TYPE="swap"
/dev/sdb1: PARTLABEL="grub" PARTUUID="4af59a27-a253-468f-b7d8-6a393325e3e8"
/dev/sdb2: UUID="4e8715bf-5c9a-685f-cb20-1669f728008a" TYPE="linux_raid_member" PARTLABEL="boot" PARTUUID="b4806082-fe18-4cdd-bdda-1993b2364125"
/dev/sdb3: UUID="a2ba0788-edc4-4de2-cb20-1669f728008a" TYPE="linux_raid_member" PARTLABEL="swap" PARTUUID="dd743bb9-cf16-4019-b9a0-1fb0588e020c"
/dev/sdb4: UUID="83dad84d-7b16-420f-cb20-1669f728008a" TYPE="linux_raid_member" PARTLABEL="root" PARTUUID="d521c87f-77b1-4a0b-b0dc-504bd7cf1e0b"
/dev/sda1: PARTLABEL="grub" PARTUUID="a87308b5-bfd9-4785-9c07-0a3067930546"
/dev/sda2: UUID="4e8715bf-5c9a-685f-cb20-1669f728008a" TYPE="linux_raid_member" PARTLABEL="boot" PARTUUID="a3492557-8512-443e-9395-a517623f9239"
/dev/sda3: UUID="a2ba0788-edc4-4de2-cb20-1669f728008a" TYPE="linux_raid_member" PARTLABEL="swap" PARTUUID="7a49380b-5d51-427b-bbbc-3f4402eb0a25"
/dev/sda4: UUID="83dad84d-7b16-420f-cb20-1669f728008a" TYPE="linux_raid_member" PARTLABEL="root" PARTUUID="d3924514-6f16-4779-aa89-af3db9b574a0"
|
Quote: | CBox grub # mdadm -D /dev/md0
/dev/md0:
Version : 0.90
Creation Time : Sat Dec 27 02:15:29 2014
Raid Level : raid1
Array Size : 131008 (127.96 MiB 134.15 MB)
Used Dev Size : 131008 (127.96 MiB 134.15 MB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Sun Jan 25 19:05:00 2015
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : 4e8715bf:5c9a685f:cb201669:f728008a
Events : 0.78
Number Major Minor RaidDevice State
0 8 2 0 active sync /dev/sda2
1 8 18 1 active sync /dev/sdb2
|
Quote: | cat /etc/mdadm.conf
ARRAY /dev/md0 metadata=0.90 UUID=4e8715bf:5c9a685f:cb201669:f728008a
ARRAY /dev/md2 metadata=0.90 UUID=83dad84d:7b16420f:cb201669:f728008a
ARRAY /dev/md1 metadata=0.90 UUID=a2ba0788:edc44de2:cb201669:f728008a
|
What I did notice is the there was no /boot/grub/device.map after the clone. I am not sure of the device.map format which use UUID.
Also when I try to recreate device.map, I get
Quote: | CBox grub # grub2-install --recheck /dev/sda
Installing for i386-pc platform.
grub2-install: error: disk `mduuid/4e8715bf5c9a685fcb201669f728008a' not found. |
I have followed this clone server procedure with MBR disks on many servers and its works fine, but this is my first time with GPT partitions.
I think the problem might be this command I used sgdisk -G /dev/sdb but I am not sure as all the UUID's match and look fine.
Any ideas what I should be checking for as I am stumped.
Thanks
Last edited by kilburna on Sun Jan 25, 2015 8:26 pm; edited 1 time in total |
|
Back to top |
|
|
kilburna Tux's lil' helper
Joined: 20 Sep 2004 Posts: 107
|
Posted: Sun Jan 25, 2015 11:44 am Post subject: grub2-install failing after RAID 1 server clone [SOLVED] |
|
|
After much reading, it seems that sgdisk is not doing a wonderful job of 100% replicating source to destination partition tables.
Code: | parted /dev/sda
set 1 bios_grub on
parted /dev/sdb
set 1 bios_grub on
grub2-install /dev/sda
grub2-install /dev/sdb
|
All done. |
|
Back to top |
|
|
|