LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 07-29-2004, 02:42 PM   #1
carneros
LQ Newbie
 
Registered: May 2004
Posts: 6

Rep: Reputation: 0
working around PARTED bug 90894 using fdisk and resize2fs


I need to shrink my root partition-- I let anaconda partition my disk because I was tired and thought it would be harmless. Turns out, due to bug 90894 (bugzilla.redhat.com/bugzilla/show_bug.cgi?id=90894)
I am hosed. Here is an exerpt from bugzilla:
" Any ext2/ext3 filesystems created during the installation procedure
of recent RedHat/Fedora Linux versions, which use the e2fsprogs for
this task, cannot be resized, moved or copied anymore using parted.
In other words: Parted can basically not be appplied to those
partitions/filesystems anymore at all. Unfortunately, the utilities
fdisk, resize2fs, etc. are not really alternatives (i.e. inconvenient
to use) when you have to resize and move partitions and filesystems
on a densely packed hard drive."
In summary, I cannot use parted to shrink my root partition so I need to use fdisk and resize2fs to do it, but I need some help.

This is my df -h output:
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 18G 2.2G 15G 14% /
/dev/hda1 99M 9.0M 85M 10% /boot
none 251M 0 251M 0% /dev/shm

and fdisk -l:

Disk /dev/hda: 20.0 GB, 20003880960 bytes
255 heads, 63 sectors/track, 2432 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 2302 18386392+ 83 Linux
/dev/hda3 2303 2432 1044225 83 Linux

So I have a lot of unused space on root, a /boot partition, and swap. I only have one disk and no tape backup mechanism available. My online research has led me to believe that if I delete the root partition with fdisk I will no longer be able to access the data, but I will not lose it. What is the difference and why does the man page of resize2fs say:
If you wish to shrink an ext2 partition, first use resize2fs to shrink
the size of filesystem. Then you may use fdisk(8) to shrink the size
of the partition. When shrinking the size of the partition, make sure
you do not make it smaller than the new size of the ext2 filesystem!
as if there is no loss of data is about to occur.

I don't seem to have anywhere to store anything as virtually the whole disk is on /root so I cannot backup with dump/restore.

I have a shaky plan, but I need help with where I am wrong or missing a step. So please refer to the following:
1) log out and boot into rescue mode; become root
2)turn off swap, delete swap partition with fdisk
3) revert root filesystem to ext2
4) resize the root filesystem with resize2fs **how can I figure out how small I can make it?
?5)create a small partition where swap was and dump/restore there? with 251M it seems unlikely that this would work.
6)delete the root partition and recreate it with the exact same starting position, to include the new resized root fs
7) make new partitions as desired with free space
7) change fstab to reflect changes to table
?will I be able to reboot?

thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
partition resizing using parted...bad memories of fdisk rextor Linux - General 1 07-30-2005 10:34 AM
What app can REALLY delete a partition? (not fdisk, parted, etc...) kornerr Linux - General 4 05-28-2005 12:14 PM
fdisk/parted/cfdisk: command not found indole Linux - Software 2 02-17-2005 12:08 PM
fdisk, parted questions? darkleaf Linux - Software 2 10-14-2004 04:07 AM
workaround for parted bug using fdisk and resize2fs carneros Linux - Newbie 2 10-05-2004 12:52 AM


All times are GMT -5. The time now is 04:55 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration