LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Another resize ext3 problem (https://www.linuxquestions.org/questions/linux-newbie-8/another-resize-ext3-problem-123378/)

gemini91 12-06-2003 07:12 PM

Another resize ext3 problem
 
Hello all,
I'm trying to do something that I think should be easy, split the last partition on my harddrive into two pieces. I've done a lot of searching in forums etc. and there seems to be a lot of conflicting info. Anyway here is my partition table :

Partition Table for /dev/hda

First Last
# Type Sector Sector Offset Length Filesystem Type (ID) Flags
-- ------- -------- --------- ------ --------- ---------------------- ---------
1 Primary 0 7817039 63 7817040 Win95 FAT32 (0B) Boot (80)
2 Primary 7817040 8028719 0 211680 Linux (83) None (00)
3 Primary 8028720 15845759 0 7817040 Linux (83) None (00)
4 Primary 15845760 58605119 0 42759360 Extended (05) None (00)
5 Logical 15845760 16828559 63 982800 Linux swap (82) None (00)
6 Logical 16828560 58605119 63 41776560 Linux (83) None (00)


I want to take 10 gig away from hda6 and create another partition. Neither parted or qtparted (frontend) will do any resizing of ext3 partitions, so I ran tune2fs to remove the journal from hda6 and then qtparted would resize it. However when I tried that I recieved the following error "an error happen during ped_file_system_open call". Do I need to resize the filesystem before resizing the partition. Plus once I resize the filesystem does the partition need to be the same size or can it be a little bigger.

Thanks, Don

J.W. 12-07-2003 03:55 AM

Don - This may turn out to be a dead end, but I suggest taking a look at BootIT NG, from http://www.terabyteunlimited.com/bootitng.html I've used it quite a bit while I was setting up my boxes. I consider it a good product and I know it can resize Windows partitions (do a defrag first to maximize the amount of contiguous space) and I suspect it may be able to do the same with ext3 partitions. To be honest though, I don't know, I'll admit I've never tried to do that.

Obviously one brute-force method would be to copy any important data in hda6 to somewhere else, drop the hda6 partition, recreate it and the (new) hda7 with the desired sizes, and then restore what you need back to hda6. Of course, whether or not this would be possible I think would depend on what you've assigned to hda6. If it's /home or /tmp, etc, you should be in good shape, if it's / then it might be a different story. I don't know if any of this will help but good luck with it. -- J.W.

gemini91 12-07-2003 07:31 PM

Thanks for the reply J.W. Hda6 contains my Fedora system and hda3 gentoo. I don't think I have enough room to tar and bzip2 hda6 but I'll give it a try. I really don't want to lose that system and the time I have in it..
again many thanks...................Don

J.W. 12-07-2003 08:14 PM

Don - one other alternative of course would be to install a second disk drive. These days storage is <$1 per gig, and with a modest outlay you could add another 40-100 G for only double digit dollars. If you've already invested a lot of time/effort into setting up your Fedora and Gentoo systems, perhaps you could justify spending (say) $80 and about half an hour of time putting in the second hard drive, rather than to spend hours and hours of time doing a complicated "Rubik's cube" type maneuver moving your OS's and files around on the single drive. I finally bit the bullet myself and bought a second hard drive, and it definitely simplifies backups, etc, by an order of magnitude. Just a thought -- J.W.

gemini91 12-08-2003 07:30 AM

Again J.W. thanks for the idea, but the machine is an IBM A31 laptop and with an extra hard drive I wouldn't be able to carry it all over the house and out on the side porch and use it. Convience rules. Thanks again ....................... Don

However it would let me move the Fedora system, then I could repartition and move it back. I'll have to look into that as an option. Many thanks...........don

gemini91 12-08-2003 07:53 AM

J.W. the old saying can't see the forest for the trees applies. I have an old adaptec scsi pcmcia that I use to back up an old 755. Linux supports it just fine, so all I need is a bigger hard drive to stick on it, and that will solve my problem plus give me away to back up the machine Great idea! Thanks again ...............Don

vincebs 12-16-2003 03:00 AM

Are there any free utilities out there that can resize an ext3 partition?

zib 12-16-2003 03:59 AM

In theory you should be fine resizing with the following method:

a) use tune2fs to remove the journal from your ext3 partition
b) Change the entry for that partition in /etc/fstab to reflect ext2
c) run mkinitrd in case you're using initrd
d) reboot
e) umount the partition
f) read man for resize2fs
g) use 'resize2fs /dev/device size' to resize the file system
h) read man for fdisk
i) use fdisk to resize the partition - but be careful so you don't make the partition smaller than the file system.
j) use tune2fs to add the journal to your ext2 partition
k) change the entry again for that partition in /etc/fstab to reflect ext3
l) reboot

This is, of course, all in theory - sometimes things go wrong.
Creating a back=up before, is prolly a good idea.

/j.


All times are GMT -5. The time now is 08:51 AM.