LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 02-03-2005, 09:50 AM   #1
georgec
LQ Newbie
 
Registered: Feb 2005
Posts: 2

Rep: Reputation: 0
resize ext2/ext3 partition


Hi there,

I am trying to resize a linux native partition with ext3 fs using parted... I wish a better software existed but anyway...

I ended up with parted after reviewing a number of threads on the Internet. At the beginning I was not able to resize the partition stating the following message:

"Filesystem was not clearly unmounted. You should use e2fsck"

I then exited parted, umounted / fs and entered parted again... I also tried e2fsck but no errors appeared...
Within parted I tried once more to resize partition and this time I got the following message:

"The ext2 filesystem has a rather strange layout. Parted can't resize this (yet)"

I have tried to resize /usr, /var and other partition bu I was getting the same messages. I have then tried to boot into Single user mode but the outcome was the same. Finally, I created a parted boot floppy, as found on the gnu parted site, and boot with that. At boot I typed the following:

linux root=/dev/hda6 single

After I have entered the system I tried once more to resize / fs but the outcome was exactly the same as above, meaning that I was getting the same error messages "The ext2 filesystem has....".

Any ideas? Has anybody used parted and worked out? The only partition I was able to resize was the SWAP which happened to be the last partition on my system.

Thanks
George
 
Old 02-03-2005, 11:15 AM   #2
srichand
Member
 
Registered: May 2004
Location: Bangalore, India
Distribution: Fedora Core 2 (modified), Debian
Posts: 34

Rep: Reputation: 15
Hi,

Did you try resize2fs ?
man resize2fs should help

Srichand
 
Old 02-03-2005, 01:59 PM   #3
georgec
LQ Newbie
 
Registered: Feb 2005
Posts: 2

Original Poster
Rep: Reputation: 0
No, I haven't used it because is more risky in the sense that you need to resize both the partition and filesystem where with parted you do both in one... like a shampoo with conditioner... 2 in 1 :-)

In this respect I prefer parted or a similar utility like partition magic as I do not feel comfortable with resize2fs. Have you or anybody else tried any of those utilities with successful results?

Thanks
George
 
Old 02-03-2005, 03:04 PM   #4
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Get knoppix, load knoppix (or other live distro) and use qtparted. Advantage of using a live distro is that you don't have to mount your partitions which is MUCH better for resizing.
 
Old 09-22-2009, 05:40 PM   #5
garydale
Member
 
Registered: Feb 2007
Posts: 142

Rep: Reputation: 23
With 4 years of hindsight...

Nowadays live CDs are all over the place. There is little reason to try to resize partitions any other way. However, the original poster's point is the problem of what is really a two or three-step process. To resize a partition, you need to change both the partition size and the size of the file system.

You may also want to move a partition. Resizing a partition changes the end point, while moving a partition changes the start, which can affect the file system as well. I consider this a very dangerous operation to attempt on disk and do not recommend doing it (at least not directly).

I recommend using the multiple-tool approach generally since you then know exactly where the failure occured. There is no guessing about whether the file system has been resized or not. GUI tools are nice, but I like to see each step complete properly before I move on. All-in-one tools just give you update messages which you may not see if your machine crashes during an operation.

To make a partition larger, there must be free space on the drive at the end of the partition. You can use the techniques below to get that free space. However, assuming that there is free space, simply adjust the size of the partition using your favourite tool (I prefer fdisk myself) then resize the file system. For ext2/3 file systems, simply enter something like resize2fs /dev/sda1 and your filesystem will adjust to the new partition size.

To make a partition smaller, you need to shrink the existing file system first. You should make it smaller than the new partition size initially then grow it back after repartitioning. To shrink it, simple specify the new size after the /dev/sda1 on the resize2fs command line. You can specify the size in 512 byte sectors (s), or in K, M or G.

To move a partition, I strongly recommend copying the data to another drive first. Then if a direct resize fails, you have a method of getting the data back.

You can also simply delete the existing partition, create the new one and copy the data back. However, if your partition tool allows you to move partitions, give it a try. This gives you two possibilities for keeping your data, since your backup copy could potentially go bad.
 
  


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
How to resize a ext3 partition? towel401 Linux - General 3 10-14-2005 05:30 PM
Can't resize ext3 Partition crack Linux - General 2 09-04-2005 07:39 AM
Ext3 Partition Resize nerotique Slackware 15 11-12-2004 04:44 PM
resize an ext3 partition with coexisting ntfs partition andy_g Linux - Newbie 1 02-03-2004 05:38 AM
how to resize a ext2 partition? Thievery Linux - Newbie 3 03-21-2002 05:19 AM

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

All times are GMT -5. The time now is 04:52 PM.

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