Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2006
    Posts
    76

    Add new hard drive space to software RAID 1

    I have a CentOS 6 box running RAID1. It had two 500 GB hard drives, but they were old and slow so I asked my provider to upgrade to new larger ones (1 GB each). The provider did this by shutting down the computer, replacing one drive, letting the RAID sync the discs, and then replacing the other and syncing again.

    As a result, the filesystem is still 500 GB, even though the drives are 1 TB each.

    What's the best way to make the new space available? Ideally, I would prefer to resize a partition instead of adding one, but I've been told that can be dangerous.

    This is what fdisk shows for /dev/sda (/dev/sdb is similar). /dev/sda4 and /dev/sdb4 are new, unused partitions.

    /dev/sda1 * 2048 526335 262144 fd Linux raid autodetect
    /dev/sda2 526336 8914943 4194304 fd Linux raid autodetect
    /dev/sda3 8914944 111314943 51200000 fd Linux raid autodetect
    /dev/sda4 111314944 976773167 432729112 5 Extended
    /dev/sda5 111316992 119705599 4194304 82 Linux swap / Solaris
    /dev/sda6 119707648 976773119 428532736 fd Linux raid autodetect

    This is /proc/mdstat:

    Personalities : [raid1]
    md3 : active raid1 sda6[3] sdb6[2]
    428531580 blocks super 1.1 [2/2] [UU]
    bitmap: 3/4 pages [12KB], 65536KB chunk

    md0 : active raid1 sda1[3] sdb1[2]
    262132 blocks super 1.0 [2/2] [UU]

    md1 : active raid1 sda2[3] sdb2[2]
    4193272 blocks super 1.1 [2/2] [UU]
    bitmap: 1/1 pages [4KB], 65536KB chunk

    md2 : active raid1 sda3[3] sdb3[2]
    51198908 blocks super 1.1 [2/2] [UU]
    bitmap: 1/1 pages [4KB], 65536KB chunk

    unused devices: <none>

    This is df:
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/md2 50394752 27437728 20397080 58% /
    tmpfs 4024632 0 4024632 0% /dev/shm
    /dev/md0 253859 109038 131715 46% /boot
    /dev/md3 421806516 30811880 369568060 8% /home
    /dev/md1 4127416 697500 3220256 18% /tmp

  2. #2
    Join Date
    Mar 2005
    Location
    Maine, USA
    Posts
    302
    If you have remote console/KVMoIP, then you could mount a linux rescue disc of some sort then resize the software raid 1 array using mdadm. It could be dangerous in that if the server crashed or shut off, your partitions might be broken. Have backups if you plan to go this route.

    Otherwise, just format the "extra" 500GB into another usable partition.

  3. #3
    Join Date
    Sep 2006
    Posts
    76
    Thanks. No remote console/KVM.

    Are these the correct steps to format the extra 500 GB into a usable partition?

    1. Using fdisk, change /dev/sda4 and /dev/sdb4 to Linux raid autodetect
    2. mdadm --create /dev/md4 --level=mirror --raid-devices=2 /dev/sda4 /dev/sdb4
    3. mkfs.ext4 /dev/md4
    4. Add to /etc/fstab and mount

  4. #4
    Join Date
    Mar 2005
    Location
    Maine, USA
    Posts
    302
    Yup that should do it.

  5. #5
    Join Date
    Sep 2006
    Posts
    76
    OK, thanks.

Similar Threads

  1. Possible to add new hard drive and make RAID 1
    By alexnuke in forum Dedicated Server
    Replies: 1
    Last Post: 09-21-2013, 12:05 PM
  2. Replies: 0
    Last Post: 03-14-2013, 10:45 PM
  3. Replies: 0
    Last Post: 03-06-2013, 08:04 PM
  4. Both hard drive disk space combined into one? Not RAID? LVM?
    By chasebug in forum Dedicated Server
    Replies: 8
    Last Post: 08-16-2011, 12:34 PM
  5. Is 2nd hard drive w/ software or MB raid enough?
    By vmhatup in forum Dedicated Server
    Replies: 26
    Last Post: 01-24-2011, 02:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •