How To Set Up Software RAID1 On A Running System... (CentOS 5

Discussion in 'HOWTO-Related Questions' started by icecold, Jul 30, 2010.

  1. icecold

    icecold New Member

    Hi,

    I have read the tutorial and before actually doing this, I have a question how to handle the extended parition. My partitioning is as follow:

    Code:
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          13      104391   83  Linux
    /dev/sda2              14       29396   236018947+  83  Linux
    /dev/sda3           29397       29657     2096482+  83  Linux
    /dev/sda4           29658       30401     5976180    5  Extended
    /dev/sda5           29658       30401     5976148+  82  Linux swap / Solaris
    I was thinking to copy the partion table and create md for sda1, sda2, sda3, sda5? And leave sda4 Extended as well as on /sdb4?

    Thanks!
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Can you post your /etc/fstab and the output of
    Code:
    mount
    ?
     
  3. icecold

    icecold New Member

    It's working

    Hi,

    In the meantime I managed to get it all working, besides some minor issues. After the migration to RAID1, the rights on the /tmp has changed to 755 which caused some problems. Changing this back to 777 solved those issues.

    Here's the output of some of the config files (for those interested):

    /etc/fstab:
    Code:
    /dev/md1                /                       ext3    defaults        1 1
    /dev/md2                /tmp                    ext3    defaults        1 2
    /dev/md0                /boot                   ext3    defaults        1 2
    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
    /dev/md3                swap                    swap    defaults        0 0
    
    mount:
    Code:
    /dev/md1 on / type ext3 (rw)
    proc on /proc type proc (rw)
    sysfs on /sys type sysfs (rw)
    devpts on /dev/pts type devpts (rw,gid=5,mode=620)
    /dev/md2 on /tmp type ext3 (rw)
    /dev/md0 on /boot type ext3 (rw)
    tmpfs on /dev/shm type tmpfs (rw)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
    
    fdisk -l:
    Code:
    Disk /dev/sda: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          13      104391   fd  Linux raid autodetect
    /dev/sda2              14       29396   236018947+  fd  Linux raid autodetect
    /dev/sda3           29397       29657     2096482+  fd  Linux raid autodetect
    /dev/sda4           29658       30401     5976180    5  Extended
    /dev/sda5           29658       30401     5976148+  fd  Linux raid autodetect
    
    Disk /dev/sdb: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1          13      104391   fd  Linux raid autodetect
    /dev/sdb2              14       29396   236018947+  fd  Linux raid autodetect
    /dev/sdb3           29397       29657     2096482+  fd  Linux raid autodetect
    /dev/sdb4           29658       30401     5976180    5  Extended
    /dev/sdb5           29658       30401     5976148+  fd  Linux raid autodetect
    
    Disk /dev/md1: 241.6 GB, 241683333120 bytes
    2 heads, 4 sectors/track, 59004720 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes
    
    Disk /dev/md1 doesn't contain a valid partition table
    
    Disk /dev/md3: 6119 MB, 6119489536 bytes
    2 heads, 4 sectors/track, 1494016 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes
    
    Disk /dev/md3 doesn't contain a valid partition table
    
    Disk /dev/md2: 2146 MB, 2146697216 bytes
    2 heads, 4 sectors/track, 524096 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes
    
    Disk /dev/md2 doesn't contain a valid partition table
    
    Disk /dev/md0: 106 MB, 106823680 bytes
    2 heads, 4 sectors/track, 26080 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes
    
    Disk /dev/md0 doesn't contain a valid partition table
    
    cat /proc/mdstat:
    Code:
    Personalities : [raid1]
    md0 : active raid1 sdb1[1] sda1[0]
          104320 blocks [2/2] [UU]
    
    md2 : active raid1 sdb3[1] sda3[0]
          2096384 blocks [2/2] [UU]
    
    md3 : active raid1 sdb5[1] sda5[0]
          5976064 blocks [2/2] [UU]
    
    md1 : active raid1 sdb2[1] sda2[0]
          236018880 blocks [2/2] [UU]
    
    unused devices: <none>
    
     

Share This Page