single HDD LVM convert to RAID1 without LVM Problems

Issues related to applications and software problems
mclien
Posts: 43
Joined: 2012/01/23 15:15:41

Re: single HDD LVM convert to RAID1 without LVM Problems

Post by mclien » 2012/03/07 08:03:04

Here is what happens, when I try to install grub on the RAID hdd (second one)
[code][root@localhost ~]# grub
Probing devices to guess BIOS drives. This may take a long time.
GNU GRUB version 0.97 (640K lower / 3072K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]
grub> root (hd1,0)
root (hd1,0)
Filesystem type unknown, partition type 0xfd
grub> setup (hd1)
setup (hd1)
Error 1(r): Cannot mount selected partition
grub> [/code]
md0 is bootable
it has a ext4 filesystem (the same the first partition on /dev/sda1, which is boot on the running LVM)
[code]yum info grub
...
Version : 0.97
Release : 75.el6
..[/code]
I tried sata mode "IDE" and "RAID" in the BIOS settings.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: single HDD LVM convert to RAID1 without LVM Problems

Post by pschaff » 2012/03/07 12:16:45

Either you or GRUB is confused about disk ordering. Please [url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=28723&forum=54]provide more information about your system[/url] by running "./getinfo.sh disk" as root and showing us the output file, as well as /boot./grub/device.map.

mclien
Posts: 43
Joined: 2012/01/23 15:15:41

Re: single HDD LVM convert to RAID1 without LVM Problems

Post by mclien » 2012/03/07 12:55:14

you forgot one possibility:
grub AND I are confused...

[code][root@localhost ~]# cat /boot/grub/device.map
# this device map was generated by anaconda
(hd0) /dev/sda[/code]

ouput of getinfo.sh:
[code]
== BEGIN uname -rmi ==
2.6.32-220.4.2.el6.i686 i686 i386
== END uname -rmi ==

== BEGIN rpm -qa \*-release\* ==
centos-release-6-2.el6.centos.7.i686
== END rpm -qa \*-release\* ==

== BEGIN cat /etc/redhat-release ==
CentOS release 6.2 (Final)
== END cat /etc/redhat-release ==

== BEGIN getenforce ==
Disabled
== END getenforce ==

== BEGIN free -m ==
total used free shared buffers cached
Mem: 942 158 783 0 32 86
-/+ buffers/cache: 39 903
Swap: 1887 0 1887
== END free -m ==


== BEGIN cat /etc/fstab ==

#
# /etc/fstab
# Created by anaconda on Thu Feb 16 14:29:40 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/VolGroup-lv_root / ext4 defaults 1 1
UUID=2fadef04-8963-4824-9e7b-96e4ee907f86 /boot ext4 defaults 1 2
/dev/mapper/VolGroup-lv_home /home ext4 defaults 1 2
/dev/mapper/VolGroup-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
== END cat /etc/fstab ==

== BEGIN df -h ==
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
50G 809M 46G 2% /
tmpfs 472M 0 472M 0% /dev/shm
/dev/sda1 485M 74M 386M 17% /boot
/dev/mapper/VolGroup-lv_home
96G 188M 91G 1% /home
== END df -h ==

== BEGIN fdisk -l ==
Disk /dev/mapper/VolGroup-lv_root doesn't contain a valid partition table
Disk /dev/mapper/VolGroup-lv_swap doesn't contain a valid partition table
Disk /dev/md0 doesn't contain a valid partition table
Disk /dev/md1 doesn't contain a valid partition table
Disk /dev/mapper/VolGroup-lv_home doesn't contain a valid partition table

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 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: 0xbb42bb42

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 19458 155777024 8e Linux LVM

Disk /dev/sdb: 163.9 GB, 163928604672 bytes
255 heads, 63 sectors/track, 19929 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: 0xaa00aa00

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 66 530113+ fd Linux raid autodetect
/dev/sdb2 67 198 1060290 82 Linux swap / Solaris
/dev/sdb3 199 19780 157292415 fd Linux raid autodetect

Disk /dev/mapper/VolGroup-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 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: 0x00000000


Disk /dev/mapper/VolGroup-lv_swap: 1979 MB, 1979711488 bytes
255 heads, 63 sectors/track, 240 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: 0x00000000


Disk /dev/md0: 542 MB, 542823424 bytes
2 heads, 4 sectors/track, 132525 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/md1: 161.1 GB, 161066310656 bytes
2 heads, 4 sectors/track, 39322829 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_home: 103.8 GB, 103846772736 bytes
255 heads, 63 sectors/track, 12625 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: 0x00000000

== END fdisk -l ==

== BEGIN blkid ==
/dev/sda1: UUID="2fadef04-8963-4824-9e7b-96e4ee907f86" TYPE="ext4"
/dev/sda2: UUID="BHl1nc-9890-nJxP-jyio-eyN8-khCO-PQZIbZ" TYPE="LVM2_member"
/dev/sdb1: UUID="f98bcd9a-7d0e-3c32-b010-0291cbc4104c" UUID_SUB="107e6035-ed32-d402-46ba-6af2f22675f0" LABEL="localhost.localdomain:0" TYPE="linux_raid_member"
/dev/sdb3: UUID="bfef2202-94eb-e37c-4b5f-f1b6f88d24d4" UUID_SUB="a9f22c26-66a3-978f-5b40-c93ceb7767a7" LABEL="localhost.localdomain:1" TYPE="linux_raid_member"
/dev/mapper/VolGroup-lv_root: UUID="e9453dc0-43cd-4187-8661-8d87b2c09d36" TYPE="ext4"
/dev/mapper/VolGroup-lv_swap: UUID="d3ce4150-b2ea-471c-b3e9-1129a9e83d46" TYPE="swap"
/dev/md0: UUID="9a2e704a-62f8-4bb0-bde4-b73248fe41b5" TYPE="ext4"
/dev/md1: UUID="b63e707f-1d77-4d0b-9eab-48ce6650e557" TYPE="ext4"
/dev/mapper/VolGroup-lv_home: UUID="64cf6218-75f4-44a3-9ddc-0dba54cebd1a" TYPE="ext4"
== END blkid ==

== BEGIN cat /proc/mdstat ==
Personalities : [raid1]
md1 : active raid1 sdb3[1]
157291319 blocks super 1.2 [2/1] [_U]

md0 : active raid1 sdb1[1]
530101 blocks super 1.2 [2/1] [_U]

unused devices: <none>
== END cat /proc/mdstat ==

== BEGIN pvs ==
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup lvm2 a-- 148.56g 0
== END pvs ==

== BEGIN vgs ==
VG #PV #LV #SN Attr VSize VFree
VolGroup 1 3 0 wz--n- 148.56g 0
== END vgs ==

== BEGIN lvs ==
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
lv_home VolGroup -wi-ao 96.71g
lv_root VolGroup -wi-ao 50.00g
lv_swap VolGroup -wi-ao 1.84g
== END lvs ==

[/code]

EDIT (forgot the disk option before, sorry)

mclien
Posts: 43
Joined: 2012/01/23 15:15:41

Re: single HDD LVM convert to RAID1 without LVM Problems

Post by mclien » 2012/03/12 14:43:42

Did I forget some information to include ?

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: single HDD LVM convert to RAID1 without LVM Problems

Post by pschaff » 2012/03/12 15:28:50

You might try adding "(hd1) /dev/sdb" to /boot/grub/device.map but I can't spot an error. Did you try debugging in GRUB per the [url=http://wiki.centos.org/TipsAndTricks/TroubleshootGRUB]Troubleshoot GRUB[/url] article?

I will do some testing of a RAID1 installation on VirtualBox when I get the chance.

Edit: Testing did not yield any enlightenment. My results:
[code]# grub
Probing devices to guess BIOS drives. This may take a long time.


GNU GRUB version 0.97 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]
grub> find /grub/stage1
find /grub/stage1
(hd0,0)
(hd1,0)
grub> root (hd1,0)
root (hd1,0)
Filesystem type is ext2fs, partition type 0xfd
grub> setup (hd1)
setup (hd1)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd1)"... 27 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd1) (hd1)1+27 p (hd1,0)/grub/stage2 /grub/grub.conf"... succeeded
Done.
grub>
# blkid | sort
/dev/md0: UUID="e22f119c-9e2a-4f95-bfba-c5820075253f" TYPE="ext4"
/dev/md1: UUID="4eb0a62f-9e18-41c9-a9f7-8aff8e4a04e8" TYPE="ext4"
/dev/sda1: UUID="138e8ea7-f813-0f5b-bb0c-a3eafa3dff2e" UUID_SUB="e87bad12-9ad6-169a-d6ac-5a78533839ce" LABEL="c6raid.dom.org:0" TYPE="linux_raid_member"
/dev/sda2: UUID="dc455c40-943d-f3c7-4770-13375f297dc0" UUID_SUB="bdf2a439-c785-ab54-1829-7526b21e99d2" LABEL="c6raid.dom.org:1" TYPE="linux_raid_member"
/dev/sda3: UUID="badee73d-945f-4b63-9338-1b3dd25a2957" TYPE="swap"
/dev/sdb1: UUID="138e8ea7-f813-0f5b-bb0c-a3eafa3dff2e" UUID_SUB="b43df9e0-ef3a-cea4-e917-60e7afee90e3" LABEL="c6raid.dom.org:0" TYPE="linux_raid_member"
/dev/sdb2: UUID="dc455c40-943d-f3c7-4770-13375f297dc0" UUID_SUB="4e998bcb-6001-4c39-9502-9c3fa7009204" LABEL="c6raid.dom.org:1" TYPE="linux_raid_member"
/dev/sdb3: UUID="fb66be46-829e-4070-bbc5-178a6088551e" TYPE="swap"
[/code]

mclien
Posts: 43
Joined: 2012/01/23 15:15:41

Re: single HDD LVM convert to RAID1 without LVM Problems

Post by mclien » 2012/03/13 08:06:45

editing the device maps doesn't helped.
I still can't install grub into sdb MBR
I tried to find a BIOS update for the (MSI) Mainboard, which is available.. if you have a Windows running on the computer. (which o means I'll never buy a MSI board again)

So I think I'll go this way:
"I was unable to boot from RAID-ed /boot partition, what ever I did. That is on CentOS 5.3 and 5.4. I disassembled boot RAID, set grub boot sector on both disks (RAID1), and I am now booting from only one disk, but other one is manualy replicated whenever I update kernel."
(from here: http://www.linuxquestions.org/questions/red-hat-31/software-raid-using-mdadm-774294/)

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: single HDD LVM convert to RAID1 without LVM Problems

Post by pschaff » 2012/03/13 14:52:10

The problem seems to be that GRUB does not recognize the filesystem on your /dev/sdb1 partition.

mclien
Posts: 43
Joined: 2012/01/23 15:15:41

Re: single HDD LVM convert to RAID1 without LVM Problems

Post by mclien » 2012/03/21 13:31:37

What I did now is these:
both HHD, with this Part table:
[code] Device Boot Start End Blocks Id System
/dev/sdb1 * 1 66 530113+ 83 Linux
/dev/sdb2 67 198 1060290 82 Linux swap / Solaris
/dev/sdb3 199 19457 154697917+ fd Linux raid autodetect[/code]
I reinstaled grub to both mbr:
[code]grub> device (hd0) /dev/sda
device (hd0) /dev/sda
grub> root (hd0,0)
root (hd0,0) Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0)
setup (hd0)
grub> device (hd0) /dev/sdb
device (hd0) /dev/sdb
grub> root (hd0,0)
root (hd0,0) Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0)
setup (hd0)
[/code]
For testing I tried to start the system with one HDD not plugged in.
But no matter which HDD is plugged in, I get a kernel Panic:
[code]Kernel Panic - not syncing: Attempt to kill init![/code]

Am I doing something wrong with the RAID?
Di I have to tweak some RAID/ mount configs?

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: single HDD LVM convert to RAID1 without LVM Problems

Post by pschaff » 2012/03/21 14:10:31

The /dev/sdb1 partition is being used in /dev/md0 and so should be type fd Linux raid autodetect as well.

mclien
Posts: 43
Joined: 2012/01/23 15:15:41

Re: single HDD LVM convert to RAID1 without LVM Problems

Post by mclien » 2012/03/21 15:08:53

Oh my mistake.
Because /boot as md-device doesn't worked at al, I set up 2 seperate /boot partitions w/o RAID to get it working.
I rsynced the content from one partition (/dev/sdb1) to the other (/dev/sda1), recraete the initramfs and reoinstaled grub in both mbr like discriped above.
Booting with both HDDs works, booting a single HDD end in a kernel panic (no matter, which one is plugged in).
The last lines before the Panic is a several repeaded line:
[code]mount: you must specify the file system type[/code]
which is most likely the error message, when linux doesn't finds the partition

Plugging in bothe HDDs makes the system boot w/o errors.

Post Reply