Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.