LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-27-2011, 09:46 PM   #1
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Rep: Reputation: Disabled
Post Resizing linux raid 1 array


Hi all,

So I have this happening to me in the last few months:

-Initially I had a 1.5TB Raid 1 array over two 1.5TB hard drives (occupying all space)

-Then one of the drive died. I replaced it with a 2TB resulting in an array of 1.5TB over one 1.5TB drive & one 2.0TB drive (leaving 500GB of unused space).

-Then the remaining 1.5TB drive died (Im lucky eh...) so I replaced it with another 2TB drive.

Now I have a 1.5TB raid array over two 2TB hard drives , each with 500GB of unused space.

My question is: Can I safely expand the array to use all the space on the disks?

I have found this procedure at howtoforge.com but I am not sure if it is reliable:

Code:
2.2 Growing An Intact Array

[...]

Now we can grow /dev/md2 as follows:

mdadm --grow /dev/md2 --size=max

--size=max means the largest possible value. You can as well specify a size in KiBytes (see previous chapter).

Then we run a file system check...

e2fsck -f /dev/md2

..., resize the file system...

resize2fs /dev/md2

... and check the file system again:

e2fsck -f /dev/md2

Afterwards you can boot back into your normal system.
 
Old 08-28-2011, 12:57 PM   #2
sandeep_hello
Member
 
Registered: Feb 2008
Posts: 62

Rep: Reputation: 1
Hi,

First you need to check status of raid by below command:

# cat /proc/mdstat

There should not be happening any sync or recovery.

After that check the current size of raid:

# mdadm -D /dev/md0 |grep -i size

Grow the RAID array:

# mdadm --grow /dev/md0 --size=max

Check the new size of RAID

# mdadm -D /dev/md0 |grep -i size

As per best practice, please try on test machine then on production server.

Regards
Sandeep Sharma
 
1 members found this post helpful.
Old 08-29-2011, 09:26 AM   #3
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
Ok what you say matches what I thought, however I'd like to ask an intermediate question without opening a separate thread. Will be easier to follow up for me an the contributors. If this pose problem or is against the forum rules please inform me I'll take appropriate actions.

Now to the question: Before I proceed with what you suggested, I want to backup the content of the array on case it crashes or I lose everything. I normally backup the array content to a hard drive installed in a vantec hot swap external bay. This enclosure if you will is connected to a vantec pci SATA adapter. There is a key in front of the enclosure to switch the power on/off and start/stop the drive.

Linux seems to be ok with this but randomly I get , in dmesg, various reiserfs error messages. I'll post them later on when they occur. To backup to this drive this is what I would normally do:

1-start the drive
2-let Linux discover it then
3-mount the drive under a mount point
4-rsync my content to it
5-umount the drive
6-stop the drive

Is this how it's normally done?

Then I'll be confident that my backup is not garbage....
 
Old 08-29-2011, 11:42 AM   #4
sandeep_hello
Member
 
Registered: Feb 2008
Posts: 62

Rep: Reputation: 1
This method seems to be fine and trustable. But I am not aware about this technology.

Other options are also available like Netbackup through that normally people takes backup.


Regards
Sandeep Sharma
 
Old 08-29-2011, 06:44 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
For a major op like this, always take at least 2 backups, and verify at least part by restoring somewhere.
An un-verified copy is NOT a backup, its just a blank media unless you've tested it.
YHBW
 
1 members found this post helpful.
Old 08-29-2011, 08:44 PM   #6
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
Quote:
An un-verified copy is NOT a backup, its just a blank media unless you've tested it.
Agreed.

Before I proceed with anything, I need to make sure the hotswap works correctly. If things go wrong, at least I will have this variable eliminated.

When I turn the drive on, this happens in dmesg:

Code:
ata2: exception Emask 0x10 SAct 0x0 SErr 0x50000 action 0xe frozen
ata2: SError: { PHYRdyChg CommWake }
ata2: hard resetting link
ata2: link is slow to respond, please be patient (ready=-19)
ata2: COMRESET failed (errno=-16)
ata2: hard resetting link
ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
ata2.00: ATA-8: Hitachi HDS5C3020ALA632, ML6OA580, max UDMA/133
ata2.00: 3907029168 sectors, multi 0: LBA48 NCQ (depth 0/32)
ata2.00: configured for UDMA/100
ata2: EH complete
scsi 1:0:0:0: Direct-Access     ATA      Hitachi HDS5C302 ML6O PQ: 0 ANSI: 5
sd 1:0:0:0: Attached scsi generic sg0 type 0
sd 1:0:0:0: [sda] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sda: sda1 < sda5 >
sd 1:0:0:0: [sda] Attached SCSI disk
Then when I turn the drive off:

Code:
ata2: exception Emask 0x10 SAct 0x0 SErr 0x10000 action 0xe frozen
ata2: SError: { PHYRdyChg }
ata2: hard resetting link
ata2: SATA link down (SStatus 0 SControl 310)
ata2: hard resetting link
ata2: SATA link down (SStatus 0 SControl 310)
ata2: hard resetting link
ata2: SATA link down (SStatus 0 SControl 310)
ata2.00: disabled
ata2: EH complete
ata2.00: detaching (SCSI 1:0:0:0)
sd 1:0:0:0: [sda] Synchronizing SCSI cache
sd 1:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
sd 1:0:0:0: [sda] Stopping disk
sd 1:0:0:0: [sda] START_STOP FAILED
sd 1:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
Im no experts in the way linux handle drives but do you guys see any errors in these lines? I highlighted the lines that I dont like... Anybody can comment?
 
Old 09-01-2011, 07:28 PM   #7
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
OK nevermind the previous post... I've figured out (partially) what is going on.... I need to spin down the drive using thr sg3_start tool (sg3_utils)... See post http://www.linuxquestions.org/questi...drives-773822/ for details.

Now to the RAID topic:

I have a problem. /dev/md6 (the array I am hoping to increase) is assembled from /dev/sde1 & /dev/sdf1. Each are 1.5TB partitions on 2TB disks. mdadm will not increase the partition size but just the array size. So consequently i need to increase the partitions size.

How do I do that?
 
Old 09-20-2011, 11:34 AM   #8
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
Solved. The underlying partitions were not properly sized. I resized the partition on the new drive and all went fine.

Regarding the hotswap thing, I am using Woodsman's scripts (with little tweaking for my server's config) and yesterday for the first time I successfully backed up one of my folders to an external HDD.

I believe this thread is solved!
Thanks for the help guys! As always, I appreciate!
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Too slow RAID 0 array in SUSE linux 10.1 nhydra Linux - General 1 06-23-2006 12:05 PM
From Xp to Linux without loosing my RAID array ? Epsilum Linux - Newbie 4 03-01-2006 02:54 PM
Sharing Raid-1 array between Linux and XP??? edbrooks Linux - Hardware 2 01-23-2006 11:23 PM
Installing Linux on a RAID 1 array essaion Linux - Hardware 2 05-03-2005 03:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:51 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