LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-08-2008, 04:50 AM   #1
Fordor
Member
 
Registered: Jun 2004
Location: Tallinn
Distribution: Slackware/Crux/SuSE
Posts: 84

Rep: Reputation: 15
Software RAID1 increase storage


Hello,

I am using centos with it's SW RAID1. My question is about increasing the size of the drives and the partitions on it. Is it possible?

What I have now is 2x500GB HDDs, I would like to have it 2x1TB HDDs without reformatting the partitions. Is it possible simply by replacing 1 of the HDDs and waiting for rebuild to complete and then replacing the second HDD?
 
Old 11-08-2008, 09:06 PM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
It should be do-able, but is always a good idea to have a current, valid, verified backup of any data you wish to retain in the event of a failure.

helpful to have:
fdisk -l
cat /proc/mdstat

I'm going to pretend that this is used solely for data and the OS is on another disk or set of disks to make it easier for me. Also, we have sda and sdb, each with a single partition sd[ab]1 which is type fd Linux raid auto and a member of sw raid 1 /dev/md0 which has an ext3 filesystem on it mounted at /data/. I think that should cover it and be about as simple a setup as i can come up with at the moment...

general idea:
- backup data you want to keep
- run fsck on unmounted /dev/md0 (good to be sure)
- depending on how brave you feel you can mount it after confirming fsck is good, \
otherwise, keep fs offline
- fail disk/partition (sda1) from array and remove it
Code:
mdadm /dev/md0 -f /dev/sda1 -r /dev/sda1
- replace sda 500GB disk with 1TB disk
- create 1TB sda1 partition on new sda (1TB) drive as type fd linux raid auto
- add it as member to md0
Code:
mdadm -a /dev/md0 /dev/sda1
- once resync completes do the same with 2nd 500GB member
Code:
watch -d cat /proc/mdstat
mdadm /dev/md0 -f /dev/sdb1 -r /dev/sdb1
<swap 500GB sdb for 1TB sdb and partition it>
mdadm -a /dev/md0 /dev/sdb1
watch -d cat /proc/mdstat
- should have two 1TB partitions with a 500GB raid1 (md0) running
- grow raid1 to use the unused space
Code:
mdadm -G /dev/md0 --size max
watch -d cat /proc/mdstat
- once sync completes, grow the filesystem (i prefer to wait for sync completion here)
Code:
resize2fs /dev/md0
- check it all out and make sure it is what you want it to be



Should also check the commands, switches, and options for accuracy.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Software raid1 shadowers Linux - Hardware 2 10-24-2008 04:08 PM
Have software raid1, but like to change to raid1+0 or 0+1, how? spaceuser Debian 8 03-17-2008 02:07 PM
Clone HDD to increase Storage DjRakso Linux - Hardware 3 03-12-2007 12:25 PM
Dynamically increase storage glowe Linux - Enterprise 1 07-02-2006 12:08 PM
Software RAID1 monitoring Sushy Slackware 1 10-05-2005 08:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration