CentOS Icon CentOS Logo
CentOS Text
   
  
www.centos.org Forum Index
   CentOS 6 - Software Support
  single HDD LVM convert to RAID1 without LVM Problems

 

 Bottom   Previous Topic   Next Topic
12>
  •  Rate Thread
      Rate this Thread
      Excellent
      Good
      Average
      Bad
      Terrible
Poster Thread
  •  mclien
      mclien
single HDD LVM convert to RAID1 without LVM Problems
#1
Jr Board Member
Joined: 2012/1/23
From
Posts: 42
I hav to change a running single HDD LVM to a (software) RAID1:

I started following this howto: (which isn't exactly what I want, because it ends up in a RAID with LVM):

I successfully did the following so far:

on the additional HDD I created a raid array with the first drive missing:
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>


I transfered the content of /boot to /dev/md0 and the content of / to /dev/md1 using rsync (because the lvm commands obviously won't work here).
I created the initrd image and edited /boot/grub/menu.lst to boot from the rai partitions and do a failback to the running system:
Quote:

default=0
fallback=1
timeout=5
#splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
title CentOS RAID (2.6.32-220.4.2.el6.i686)
root (hd1,0)
kernel /vmlinuz-2.6.32-220.4.2.el6.i686 ro root=/dev/md1 rd_NO_LUKS LANG=en_US.UTF-8 KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys crashkernel=auto quiet
initrd /initramfs-2.6.32-220.4.2.el6.i686.img-raid
title CentOS (2.6.32-220.4.2.el6.i686)
root (hd0,0)
kernel /vmlinuz-2.6.32-220.4.2.el6.i686 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto quiet rd_LVM_LV=VolGroup/lv_root rd_NO_DM
initrd /initramfs-2.6.32-220.4.2.el6.i686.img

But grub complains it can't mount the selected file system.

My guess is the transfer via rsync is not the best way and the filesystem is deprected.
Can anyone hint me how to get the filesystem trasnferd corrctly or who to repair the filesystem on the raid partition?

Thanks
Posted on: 2012/3/2 10:34
Create PDF from Post Print
Top
  •  TrevorH
      TrevorH
Re: single HDD LVM convert to RAID1 without LVM Problems
#2
Moderator
Joined: 2009/9/24
From Brighton, UK
Posts: 6338
Make sure you have the latest version of dracut installed and, if you built your initrd with the older one, rebuild it. There's a bug in the 6.2 version of dracut that affects booting from RAID 1 with a missing device.
_________________
Linux/VoIP Systems Administrator
Posted on: 2012/3/2 11:33
Create PDF from Post Print
Top
  •  mclien
      mclien
Re: single HDD LVM convert to RAID1 without LVM Problems
#3
Jr Board Member
Joined: 2012/1/23
From
Posts: 42
So I build the initrd with dracut instead of mkinitrd?
and this:
Release : 256.el6_2.1
is the corrct version of dracut. (at least the last I get via yum)

EDIT:
here is the missing "e"
Posted on: 2012/3/2 13:20
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: single HDD LVM convert to RAID1 without LVM Problems
#4
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
Yes and yes.
# rpm -q dracut
dracut-004-256.el6_2.1.noarch
# cat /etc/redhat-release 
CentOS release 6.2 (Final)
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2012/3/4 2:43
Create PDF from Post Print
Top
  •  TrevorH
      TrevorH
Re: single HDD LVM convert to RAID1 without LVM Problems
#5
Moderator
Joined: 2009/9/24
From Brighton, UK
Posts: 6338
There's still an /sbin/mkinitrd executable but it's a wrapper and calls dracut to do the work.
_________________
Linux/VoIP Systems Administrator
Posted on: 2012/3/4 2:47
Create PDF from Post Print
Top
  •  mclien
      mclien
Re: single HDD LVM convert to RAID1 without LVM Problems
#6
Jr Board Member
Joined: 2012/1/23
From
Posts: 42
There must be still a mistake in my way to do it...
-I have setup my RAID as stated above
-I boot the existing LVm system from the first HDD
-mount the RAID system:
[root@localhost ~]# mount /dev/md1 /mnt
[root@localhost ~]# mount /dev/md0 /mnt/boot

-update dracut
-use rsync to copy the content of the LVm to the raid partitions:
rsync -vax / /mnt
rsync -vax /boot/ /mnt/boot

-chroot to the raidsystem:
chroot /mnt

-use dracut to generate the initrd:
dracut --mdadmconf --force /boot/initramfs-2.6.32-220.4.2.el6.i686.img-raid 2.6.32-220.4.2.el6.i686

-leave chroot
-edit /mnt/etc/fstab to this:
[root@localhost ~]# cat /mnt/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/md1                /                       ext4    defaults        1 1
/dev/md0                /boot                   ext4    defaults        1 2
/dev/sdb2               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

reboot

Still "Grub error 17: cannot mount selected partition"

So where is my mistake?
Thanks
Posted on: 2012/3/5 10:08
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: single HDD LVM convert to RAID1 without LVM Problems
#7
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
What's in /boot/grub/grub.conf on /dev/md0?
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2012/3/5 19:04
Create PDF from Post Print
Top
  •  mclien
      mclien
Re: single HDD LVM convert to RAID1 without LVM Problems
#8
Jr Board Member
Joined: 2012/1/23
From
Posts: 42
you mean this: ?
[root@localhost ~]# mount /dev/md1 /mnt 
[root@localhost ~]# mount /dev/md0 /mnt/boot 
[root@localhost ~]# cat /mnt/boot/grub/grub.conf 
.....
default=0 
timeout=5 
splashimage=(hd0,0)/grub/splash.xpm.gz 
hiddenmenu 
title CentOS (2.6.32-220.4.2.el6.i686)         
root (hd0,0)         
kernel /vmlinuz-2.6.32-220.4.2.el6.i686 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 \
  KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys rd_NO_MD rd_LVM_LV=VolGroup/lv_swap 
  SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto quiet rd_LVM_LV=VolGroup/lv_root rd_NO_DM         
initrd /initramfs-2.6.32-220.4.2.el6.i686.img


OK, thats not correct. But isn't that irrelevant, because I boot from the existing grub entry of the first HDD, which contains this:?
default=0 
fallback=1 
timeout=5 
#splashimage=(hd0,0)/grub/splash.xpm.gz 
#hiddenmenu 

title CentOS RAID (2.6.32-220.4.2.el6.i686)         
root (hd1,0)         
kernel /vmlinuz-2.6.32-220.4.2.el6.i686 ro root=/dev/md1 LANG=en_US.UTF-8  KEYBOARDTYPE=pc \
  KEYTABLE=de-latin1-nodeadkeys crashkernel=auto quiet         
initrd /initramfs-2.6.32-220.4.2.el6.i686.img-raid 

title CentOS (2.6.32-220.4.2.el6.i686)         
root (hd0,0)         
kernel /vmlinuz-2.6.32-220.4.2.el6.i686 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 \
  KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys rd_NO_MD rd_LVM_LV=VolGroup/lv_swap \
  SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto quiet rd_LVM_LV=VolGroup/lv_root rd_NO_DM         
initrd /initramfs-2.6.32-220.4.2.el6.i686.img-raid
[Moderator edit: Wrap long lines.]

Or didn't I get the mechanism of grub right?
Posted on: 2012/3/6 8:49
Create PDF from Post Print
Top
  •  mclien
      mclien
Re: single HDD LVM convert to RAID1 without LVM Problems
#9
Jr Board Member
Joined: 2012/1/23
From
Posts: 42
or could it be that grub doesn't supports ext4 on md devices, while it supports ext4 on /dev/sda ?
Posted on: 2012/3/6 11:37
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: single HDD LVM convert to RAID1 without LVM Problems
#10
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
GRUB will boot from ext4 on software RAID1. I can't spot the problem but you will need to boot from the RAID to accomplish your goal. I'd fix the GRUB entry of /dev/md0, make it the first disk, and if still having problems, then read:
http://wiki.centos.org/TipsAndTricks/TroubleshootGRUB
http://wiki.centos.org/TipsAndTricks/ReinstallGRUB
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2012/3/6 13:47
Create PDF from Post Print
Top
  •  mclien
      mclien
Re: single HDD LVM convert to RAID1 without LVM Problems
#11
Jr Board Member
Joined: 2012/1/23
From
Posts: 42
Here is what happens, when I try to install grub on the RAID hdd (second one)
[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�: Cannot mount selected partition 
grub>      

md0 is bootable
it has a ext4 filesystem (the same the first partition on /dev/sda1, which is boot on the running LVM)
yum info grub
...
Version     : 0.97 
Release     : 75.el6
..

I tried sata mode "IDE" and "RAID" in the BIOS settings.
Posted on: 2012/3/7 8:03
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: single HDD LVM convert to RAID1 without LVM Problems
#12
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
Either you or GRUB is confused about disk ordering. Please provide more information about your system by running "./getinfo.sh disk" as root and showing us the output file, as well as /boot./grub/device.map.
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2012/3/7 12:16
Create PDF from Post Print
Top
  •  mclien
      mclien
Re: single HDD LVM convert to RAID1 without LVM Problems
#13
Jr Board Member
Joined: 2012/1/23
From
Posts: 42
you forgot one possibility:
grub AND I are confused...

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


ouput of getinfo.sh:
== 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 ==



EDIT (forgot the disk option before, sorry)
Posted on: 2012/3/7 12:55
Create PDF from Post Print
Top
  •  mclien
      mclien
Re: single HDD LVM convert to RAID1 without LVM Problems
#14
Jr Board Member
Joined: 2012/1/23
From
Posts: 42
Did I forget some information to include ?
Posted on: 2012/3/12 14:43
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: single HDD LVM convert to RAID1 without LVM Problems
#15
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
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 Troubleshoot GRUB 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:
# 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" 
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2012/3/12 15:28
Create PDF from Post Print
Top
  •  mclien
      mclien
Re: single HDD LVM convert to RAID1 without LVM Problems
#16
Jr Board Member
Joined: 2012/1/23
From
Posts: 42
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/)
Posted on: 2012/3/13 8:06
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: single HDD LVM convert to RAID1 without LVM Problems
#17
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
The problem seems to be that GRUB does not recognize the filesystem on your /dev/sdb1 partition.
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2012/3/13 14:52
Create PDF from Post Print
Top
  •  mclien
      mclien
Re: single HDD LVM convert to RAID1 without LVM Problems
#18
Jr Board Member
Joined: 2012/1/23
From
Posts: 42
What I did now is these:
both HHD, with this Part table:
   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

I reinstaled grub to both mbr:
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)

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:
Kernel Panic - not syncing: Attempt to kill init!


Am I doing something wrong with the RAID?
Di I have to tweak some RAID/ mount configs?
Posted on: 2012/3/21 13:31
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: single HDD LVM convert to RAID1 without LVM Problems
#19
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
The /dev/sdb1 partition is being used in /dev/md0 and so should be type fd Linux raid autodetect as well.
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2012/3/21 14:10
Create PDF from Post Print
Top
  •  mclien
      mclien
Re: single HDD LVM convert to RAID1 without LVM Problems
#20
Jr Board Member
Joined: 2012/1/23
From
Posts: 42
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:
mount: you must specify the file system type

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.
Posted on: 2012/3/21 15:08
Create PDF from Post Print
Top
 Top   Previous Topic   Next Topic
12>

 


 You cannot start a new topic.
 You can view topic.
 You cannot reply to posts.
 You cannot edit your posts.
 You cannot delete your posts.
 You cannot add new polls.
 You cannot vote in polls.
 You cannot attach files to posts.
 You cannot post without approval.




"Linux" is a registered trademark of Linus Torvalds. | All other trademarks are property of their respective owners. | All other content is Copyright @ 2004-2009 by the CentOS Project or "each individual contributor (forums, comments, etc.) unless otherwise assigned".| Theme based on a theme by 7dana.com