Skip to contentSkip to conversation

Extend raid 5

DISCUSSION buliwyf 6 participants 7 messages Jan 12, 2004 MD RAID

lore
Share & tools
lore

buliwyf

author
#0 lore raw

Hello

I have the following problem.
I have set up a Linux Software Raid 5 with 4 160GB Disks. This works well. Now i run out of Disk Space and want to add another 160 GB Disk on the fly. Is this possible without loosing Data? my /etc/raidtab

raiddev /dev/md0

        raid-level      5
        nr-raid-disks   4
        nr-spare-disks  0

persistent-superblock 1
parity-algorithm left-symmetric
chunk-size 32
device /dev/hdi1
raid-disk 0
device /dev/hdj1
raid-disk 1
device /dev/hdk1
raid-disk 2
device /dev/hdl1
raid-disk 3

My system is a Debian/gnu Linux Woody Box.
Installed is Raidtools2 and mdadm.
I tried the raidreconf tool but always got an error message. Has anybody the same problem yet and has solved it, or can tell me a solution?

cYa
Dominik Sennfelder

#1 lore raw
Quoted 6 lines · buliwyf

Hello

I have the following problem.
I have set up a Linux Software Raid 5 with 4 160GB Disks. This works well. Now i run out of Disk Space and want to add another 160 GB Disk on the fly. Is this possible without loosing Data?

No, the raid format splits the raid stripes sequencially between the drives available in the array. So adding an extra online disk would really mess up the formatting of the array, and therefore isn't allowed.

There really isn't a way to get the redundancy of raid and the size addition capabilities of LVM when you only want to add one disk.

If you had lvm on top of raid, you could add that one disk to your lvm set, but it wouldn't be redundant unless you added two disks and added a raid1 array to your lvm set.

I'd also suggest you get an extra drive as a spare for your raid5 array.

I'd suggest you add the drive as a seperate filesystem until you can setup your array with lvm on raid.

Mike

#2 lore raw
Quoted 13 lines · Mike Fedyk
Quoted 4 lines · buliwyf

I have the following problem.
I have set up a Linux Software Raid 5 with 4 160GB Disks. This works well. Now i run out of Disk Space and want to add another 160 GB Disk on the fly. Is this possible without loosing Data?

No, the raid format splits the raid stripes sequencially between the drives available in the array. So adding an extra online disk would really mess up the formatting of the array, and therefore isn't allowed.

There really isn't a way to get the redundancy of raid and the size addition capabilities of LVM when you only want to add one disk.

[...]

Quoted 2 lines

I'd suggest you add the drive as a seperate filesystem until you can setup your array with lvm on raid.

Hi Mike. I read about LVM some time ago and decided to use that as it seemed to solve my problem of the ever-growing data volume I need to store.

However, after the initial setup I quickly dropped the LVM idea again since it only _seemed_ to solve my problem. As I understand it, LVM allows the addition of extra volumes but it does nothing at the level of the filesystem which resides on top. So in order to effectively grow my filesystem, which is the ultimate goal of course, I'd need to delete the current FS and make a new -bigger- one. And last time I checked this definitely kills your data.

Otherwise, adding a 40 GB physical volume to a 120 GB raid5 / LVM set just gives me one 120 GB partition and [room for] another 40 GB partition. There is NO gain whatsoever using LVM here compared to when I would just have added a single 40GB disk all by itself without using LVM in the first place, is there ?

This has always left me wondering. Did I miss something (except using some alpha FS-resize code...) ?

Greetings,
Maarten

#3 lore raw
Quoted 12 lines · Maarten v d Berg

Hi Mike. I read about LVM some time ago and decided to use that as it seemed to solve my problem of the ever-growing data volume I need to store.

However, after the initial setup I quickly dropped the LVM idea again since it only _seemed_ to solve my problem. As I understand it, LVM allows the addition of extra volumes but it does nothing at the level of the filesystem which resides on top. So in order to effectively grow my filesystem, which is the ultimate goal of course, I'd need to delete the current FS and make a new -bigger- one. And last time I checked this definitely kills your data.

Quoted 8 lines

Otherwise, adding a 40 GB physical volume to a 120 GB raid5 / LVM set just gives me one 120 GB partition and [room for] another 40 GB partition. There is NO gain whatsoever using LVM here compared to when I would just have added a single 40GB disk all by itself without using LVM in the first place, is there ?

This has always left me wondering. Did I miss something (except using some alpha FS-resize code...) ?

Yes, ext2, ext3, xfs, jfs and reiserfs can all be extended without destroying the data. Some of them can be reduced, too.

Signature · 7 lines
Måns Rullgård
[email protected]

-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
In reply to Maarten v d Berg
Quoted 9 lines · Maarten v d Berg

[...]
Hi Mike. I read about LVM some time ago and decided to use that as it seemed to solve my problem of the ever-growing data volume I need to store.

However, after the initial setup I quickly dropped the LVM idea again since it only _seemed_ to solve my problem. As I understand it, LVM allows the addition of extra volumes but it does nothing at the level of the filesystem which resides on top. So in order to effectively grow my filesystem, which is the ultimate goal of course, I'd need to delete the current FS and make a new -bigger- one. And last time I checked this definitely kills your data.

Otherwise, adding a 40 GB physical volume to a 120 GB raid5 / LVM set just gives me one 120 GB partition and [room for] another 40 GB partition. There is NO gain whatsoever using LVM here compared to when I would just have added a single 40GB disk all by itself without using LVM in the first place, is there ?

This has always left me wondering. Did I miss something (except using some alpha FS-resize code...) ?

This is precisely the point, you have to resize your filesystem so that the extra space added to your LVM device is used. There are many options, you can either use a userland tool (resize2fs, resize_reiserfs, ...) for resizing an *unmounted* filesystem, or you can do it in the kernel (mount -o remount,resize=<size> <device>). As you can see, doing it in the kernel has the extra advantage of allowing you to resize a *mounted* filesystem.

Filesystem resizing is more stable than you think, for example the commercial program Partition Magic is based on resize2fs (but I am not sure if I can convince you with this example since proprietary software is evil :P).

Signature · 1 line
Marc Bevand
#5 lore raw
Quoted 12 lines · Marc Bevand
Quoted 10 lines · Maarten v d Berg

[...]

Otherwise, adding a 40 GB physical volume to a 120 GB raid5 / LVM set just gives me one 120 GB partition and [room for] another 40 GB partition. There is NO gain whatsoever using LVM here compared to when I would just have added a single 40GB disk all by itself without using LVM in the first place, is there ?

This has always left me wondering. Did I miss something (except using some alpha FS-resize code...) ?

Quoted 7 lines

This is precisely the point, you have to resize your filesystem so that the extra space added to your LVM device is used. There are many options, you can either use a userland tool (resize2fs, resize_reiserfs, ...) for resizing an *unmounted* filesystem, or you can do it in the kernel (mount -o remount,resize=<size> <device>). As you can see, doing it in the kernel has the extra advantage of allowing you to resize a *mounted* filesystem.

My raid filesystem is not part of the normal linux FS tree, so for me it is perfectly okay to umount the system. I tend to only use reiserfs.

Quoted 4 lines

Filesystem resizing is more stable than you think, for example the commercial program Partition Magic is based on resize2fs (but I am not sure if I can convince you with this example since proprietary software is evil :P).

I know partition magic but at the time I tried it it did not understand reiserfs so I dropped it. I don't know what the current version can do.

In any case I didn't want to run the risk at the time; I had something which could be called a "backup" (with some imagination) but it consisted of several tapes, disks and whatnot that could help restoring in case of a disaster but it was by no means near anything complete nor recent. In other words, restoring would have cost me at least a full weekend and would have cost me anything between 5 - 20% of my data. I can accept that kind of risk for statistic 'normal' disasters but not for experiments with a higher- than-normal risk of losing the entire filesystem.

The problem with adding a non-redundant drive to an existing raid-based LVM persists however. By adding that one drive and extending the FS to include that you introduce a single point of failure. Bye bye raid-redundancy...

Greetings,
Maarten

#6 lore raw
In reply to Maarten v d Berg

LVM
You can extend a logical volume with "lvextend".
You can also extend a filesystem, not sure if this is safe. Don't add a single disk. Create a RAID1 or RAID5, and add that. It may cost more, but can you risk data loss?
I think I have read that there is a utility to add a disk to a RAID5. But I think it is not considered safe/stable. I can't find any info about it.

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Maarten v d Berg
Sent: Monday, January 12, 2004 4:21 AM
To: [email protected]
Subject: Re: Extend raid 5

Quoted 8 lines · Mike Fedyk
Quoted 4 lines · buliwyf

I have the following problem.
I have set up a Linux Software Raid 5 with 4 160GB Disks. This works well. Now i run out of Disk Space and want to add another 160 GB Disk on the fly. Is this possible without loosing Data?

No, the raid format splits the raid stripes sequencially between the

drives

Quoted 5 lines

available in the array. So adding an extra online disk would really mess up the formatting of the array, and therefore isn't allowed.

There really isn't a way to get the redundancy of raid and the size addition capabilities of LVM when you only want to add one disk.

[...]

Quoted 2 lines

I'd suggest you add the drive as a seperate filesystem until you can setup your array with lvm on raid.

Hi Mike. I read about LVM some time ago and decided to use that as it seemed
to solve my problem of the ever-growing data volume I need to store.

However, after the initial setup I quickly dropped the LVM idea again since it
only _seemed_ to solve my problem. As I understand it, LVM allows the addition of extra volumes but it does nothing at the level of the filesystem

which resides on top. So in order to effectively grow my filesystem, which is
the ultimate goal of course, I'd need to delete the current FS and make a new
-bigger- one. And last time I checked this definitely kills your data.

Otherwise, adding a 40 GB physical volume to a 120 GB raid5 / LVM set just gives me one 120 GB partition and [room for] another 40 GB partition. There is NO gain whatsoever using LVM here compared to when I would just have
added a single 40GB disk all by itself without using LVM in the first place,

is there ?

This has always left me wondering. Did I miss something (except using some alpha FS-resize code...) ?

Greetings,
Maarten

-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html