Skip to contentSkip to conversation

Unsure of changes to array

DISCUSSION Jonathan Gazeley 3 participants 3 messages Oct 17, 2007 MD RAID

lore
Share & tools
lore
#0 lore raw

Dear all,

This is hopefully a simple question for you to answer, but I am fairly new to RAID and don't want to risk losing my data!

My setup is as follows:
- I have four 500GB disks. Each disk is split into a 5GB partition, and a 495GB partition.
- The four 5GB partitions are in a RAID-5 array, md0. CentOS is installed on this 15GB partition.
- The four 495GB partiions are in a RAID-5 array, md1. This partition holds my user data.

However, I have decided I no longer wish to two arrays across the disks. I've added a fifth disk on which I have installed the OS without RAID, meaning the old md0 is currently unused. Can I simply remove the four 5GB partitions, and resize the four 495GB partitions to fill the entire disk? Will this break anything?

Before anybody tells me off for having the OS on a non-RAID disk, this is a home server and therefore high availability is not an issue. But keeping my data safe against disk failures is important to me.

Cheers,
Jonathan

----------------------
Jonathan Gazeley
ResNet | Wireless Team
Information Services
----------------------

#1 lore raw

----- Message from [email protected] ---------
Date: Wed, 17 Oct 2007 15:04:52 +0100
From: Jonathan Gazeley <[email protected]>
Reply-To: Jonathan Gazeley <[email protected]>
Subject: Unsure of changes to array
To: [email protected]

Quoted 19 lines

Dear all,

This is hopefully a simple question for you to answer, but I am fairly new to RAID and don't want to risk losing my data!

My setup is as follows:
- I have four 500GB disks. Each disk is split into a 5GB partition, and a 495GB partition.
- The four 5GB partitions are in a RAID-5 array, md0. CentOS is installed on this 15GB partition.
- The four 495GB partiions are in a RAID-5 array, md1. This partition holds my user data.

However, I have decided I no longer wish to two arrays across the disks. I've added a fifth disk on which I have installed the OS without RAID, meaning the old md0 is currently unused. Can I simply remove the four 5GB partitions, and resize the four 495GB partitions to fill the entire disk? Will this break anything?

Quoted 7 lines

Before anybody tells me off for having the OS on a non-RAID disk, this is a home server and therefore high availability is not an issue. But keeping my data safe against disk failures is important to me.

Cheers,
Jonathan

----- End message from [email protected] -----

***CAUTION***CAUTION***CAUTION***
Do backups if you can..
Are the RAID partitions on your disk the first partition or a different one?
If its not the first partition you'll have _move_ your partition to the beginning of the disk.
So assuming your first disk is /dev/sda, sda1 your OS partition which want to recycle, sda2 your RAID partition you could do:
dd if=/dev/sda2 of=/lots_of_space_here/sda.dump
then repartition your sda, now sda1 is your RAID partition and it spans across the whole drive
dd if=/my_new_disk/sda.dump of=/dev/sda1

After that you should be able to assemble your RAID again with /dev/sda1 instead of /dev/sda2. If that works, continue with the other disks.
If it doesn't work your array should be degraded and you should still be able to add /dev/sda1 and then md should sync to it to become clean again.
Note that during this whole operation you will be vulnerable to any disk failures. You may think about buying another disk and converting to raid6 for an additional layer of protection before attempting this.
If you have friend who has a faint idea what you do have him join you to look over your shoulder and stop you from doing silly mistakes (e.g. mixing up "if" and "of" during dd). This is a very dangerous undertaking make one mistake and your data may be gone... I hope this helps..
Alex.

========================================================================
# _ __ _ __ http://www.nagilum.org/ \n icq://69646724 #
# / |/ /__ ____ _(_) /_ ____ _ [email protected] \n +491776461165 #
# / / _ / _ / / / // / ' \ Amiga (68k/PPC): AOS/NetBSD/Linux #
# /_/|_/\_,_/\_, /_/_/\_,_/_/_/_/ Mac (PPC): MacOS-X / NetBSD /Linux #
# /___/ x86: FreeBSD/Linux/Solaris/Win2k ARM9: EPOC EV6 #
========================================================================

----------------------------------------------------------------
cakebox.homeunix.net - all the machine one needs..

#2 lore raw
In reply to Jonathan Gazeley
Quoted 12 lines · Jonathan Gazeley

Dear all,

This is hopefully a simple question for you to answer, but I am fairly new to RAID and don't want to risk losing my data!

My setup is as follows:
- I have four 500GB disks. Each disk is split into a 5GB partition, and a 495GB partition.
- The four 5GB partitions are in a RAID-5 array, md0. CentOS is installed on this 15GB partition.
- The four 495GB partiions are in a RAID-5 array, md1. This partition holds my user data.

Quoted 1 line

However, I have decided I no longer wish to two arrays across the disks. I've added a fifth disk on which I have installed the OS without RAID, meaning the old md0 is currently unused. Can I simply remove the four 5GB partitions, and resize the four 495GB partitions to fill the entire disk? Will this break anything?

Not unless you make a mistake in typing, or your hardware or power fails during the process. Of course in that case you will possibly lose everything.

Quoted 2 lines

Before anybody tells me off for having the OS on a non-RAID disk, this is a home server and therefore high availability is not an issue. But keeping my data safe against disk failures is important to me.

Having your o/s and swap on RAID reduces your chances of losing your data. If it were me and reliability were the goal, I would have the o/s mirrored on the first two drives (as seen by the BIOS) so you boot if one fails hard, then put swap RAID-10 in the little 5GB partition on the other three drives, then convert the raid-5 to raid-6 using the rest of the added fifth drive.

Anything which reduces the chances of an unclean shutdown improves the chances of keeping your data. A decent UPS is a big help in that regard. Disk failures on the data drives are not the only threat to your data!

Signature · 3 lines
bill davidsen <[email protected]>
 CTO TMR Associates, Inc
 Doing interesting things with small computers since 1979