-   Linux - Server (
-   -   Is resize2fs safe? (

Clemente 10-15-2007 06:31 AM

Is resize2fs safe?
Hi all,

what do you think about resize2fs? This tool can be used to resize a ext2/3 filesystem. I did not find any hint, that the use of resize2fs is risky in sense of data loss.

But I remember from my old windows time, that people always warned to make backups before resizing any partition.
I know that partition and filesystem are two seperate things. The partition is a raid 5 array and I want to add some devices with mdadm. After adding them, I think about resize2fs to get the filesystem using the larger partition.

Thank you for sharing your opinion,

Slick666 10-15-2007 08:12 AM

Check out

I've always liked ReiserFS and have used it for a long time. It has known to have some issues with the file system recovery but in day to day operations I've NEVER had a problem. It's a Journaled file system and I have recovered from the occasional power failure (also known as tripping over the cord) without error. If your really worried about data security I would suggest you rely more on a good backup scheme rather than any particular file system.

Hope this helps

Clemente 10-15-2007 08:44 AM

Hi Slick,

thanks for your answer - in fact I often thought about ext3 vs reiser. And I never did get a real decision. ;-)

In this case, my worries are about filesystem stability, but the stability of the filesystems resizing program (resize2fs).

The situation is as following:
I have a server with a 1TB raid 5 device and a second 1TB raid 5 device for dayly backups.
Unfortunately these devices become too small, so I have to add some storage space. If possible, I would like to do it without creating a complete new filesystem (and all the work with copying the files, providing some temporarily space for these backups and so on).
Another reason for a "hot" resize is the fact, that the data growth on this server is not predictable. I don't want to do all the copy work every one or two months. ;-)
The guy that pays for all the hdd devices doesn't give me the hardware for a _really_ big device.

Linux software raid provides hot-adding and resizing a raid 5 device. And ext3 (as well as reiser) supports resizing the "living" filesystem. Both features allow hot-adding devices.

It is just, that I am worried about this filesystem resizing operation. I don't really want to risk a total data loss due to a risky resize program.


Slick666 10-15-2007 10:34 AM

Sorry for reading your message so quickly. I think I understand the situation better. I operate an 840GB Raid5 with a networked off site backup and have happed on this once before.

What I would recommend before doing anything is buy two 500GB hds ($100 each) and a usb to IDE (or SATA) and making a static backup of the data before doing ANYTHING. You might be able to get away with the mirrored server but if this resizing takes any significant amount of time or trickery you run the risk of that raid going down with no redundancy. So for the money I would make a quick static backup.

In terms of expanding your raid I'm assuming you had a hardware Raid5 card with 1 logical drive (at 1 TB) and your replacing your drives with a larger set to increase your overall size. What I would do is keep the file system the same and add another partition. If the type of data your storing allows it. My raid has two primary partitions right now. I'm fortunate in that I store a lot of small files in many sub folders so when one directory got too big to fit all on one partition I moved one large sub-folder to the other partition and made a symbolic link back to the other drive. This approach might work for you as well depending on the type and size of the data files your storing.

The only time I've tried to expand a file system was using the parted libraries and that had a seg-fault at 700GB. (thank god for Backups :)) so I would avoid the problem all together if possible.

dadenn 09-02-2008 04:47 PM

Is resize2fs safe?
Hi Clement,

The inherent danger in resizing a partition is generally with trying to make it smaller. When making it larger, it is much less dangerous. That being said, a full backup of the data before beginning your journey is HIGHLY advisable. Remember, 90% of all administrators that leave their jobs involuntarily do so because of irrevocable loss of data.


syg00 09-02-2008 05:18 PM

Anybody that uses a tool like gparted to resize partitions uses something like resize2fs "under the covers" to also resize the filesystem. Gets done all the time without problem.
But it usually ain't done on terabytes of (the companys) data.

All the above advice seems sensible ... see my sigline.

All times are GMT -5. The time now is 12:14 PM.