LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
LinkBack Search this Thread
Old 11-11-2013, 05:41 AM   #1
DebianUser
Member
 
Registered: Apr 2010
Posts: 75

Rep: Reputation: 15
Upgrading disks in software raid1


Due to my current 1TB disks nearing capacity I now need to upgrade them to a larger size. Currently they store all the houses data so i'm a little bit weary of messing things up.

My current setup is as follows

cat /proc/mdstat
Code:
Personalities : [raid1]
md0 : active raid1 sda1[0] sdb1[1]
      974117184 blocks [2/2] [UU]

unused devices: <none>
fdisk -l
Code:
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 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: 0x0002a68d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1      121272   974117308+  fd  Linux raid autodetect
/dev/sda2          121273      121601     2642692+  82  Linux swap / Solaris

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 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: 0x00039142

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1      121272   974117308+  fd  Linux raid autodetect
/dev/sdb2          121273      121601     2642692+  82  Linux swap / Solaris

Disk /dev/md0: 997.5 GB, 997495996416 bytes
2 heads, 4 sectors/track, 243529296 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/md0 doesn't contain a valid partition table
What i'd like to know is what is the safest way of upgrading each disk.

Do I fail the 1st drive?

Code:
mdadm /dev/md0 --fail /dev/sdb1
physically replace it

Copy the partition table from the old drive to the new one

Code:
sfdisk -d /dev/sda | sfdisk /dev/sdb
and adjust or just create new paritions using fdisk?

My first parition is my boot/main one and second is swap, swap uses 2642692 blocks.

So do I create a primary parition of the full disk size -2642692 blocks then create the secondary swap one?

Update grub (not sure if this is right order????
Code:
root (hd0,0)
root (hd1,0)
setup (hd1)
add drive back into the array
Code:
mdadm /dev/md0 --add /dev/sdb1
wait for rebuild, fail /dev/sda and repeat steps, grow /dev/md0

If i'm completely on the wrong track please let me know.

Last edited by DebianUser; 11-11-2013 at 05:48 AM.
 
Old 11-11-2013, 09:35 AM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Philly, PA
Distribution: Kubuntu x64, RHEL, Fedora Core, FreeBSD, Windows x64
Posts: 1,335
Blog Entries: 33

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
The safest way to upgrade the disk is to not fail any drives. Create a second RAID 1 array comprised of larger disks and then rsync the data to it. Sometimes the best solution is the most obvious/simplest one.
 
Old 11-12-2013, 03:16 AM   #3
DebianUser
Member
 
Registered: Apr 2010
Posts: 75

Original Poster
Rep: Reputation: 15
Unfortunately due to hardware constraints it's not possible to create a second array.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
software raid1, underlying disks swamp-dog Linux - General 4 06-08-2013 12:57 PM
New disks (RAID1), not enough space? ScorchPipe Linux - General 1 01-17-2011 01:18 AM
Making bootable both disks of mdadm raid1 chiendarret Linux - Software 0 03-08-2009 05:15 AM
Have software raid1, but like to change to raid1+0 or 0+1, how? spaceuser Debian 8 03-17-2008 02:07 PM
Change raid1-mdadm disks Debian Suhy Linux - Software 1 07-03-2006 03:48 PM


All times are GMT -5. The time now is 02:41 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration