Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
expand an xfs partition
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
kc8tbe
Tux's lil' helper
Tux's lil' helper


Joined: 12 Aug 2003
Posts: 135
Location: Cleveland, OH USA

PostPosted: Sun Aug 24, 2003 12:51 am    Post subject: expand an xfs partition Reply with quote

I want to resize my root partition (xfs) to take advantage of free space on my HD. The forum has, thusfar, not been helpful on this matter.
Supposing I could resize the existing partition in which the xfs file system resides without changing its starting block, the utility xfs_growfs would work very nicely. Unfortunately, I can't find a utility to resize the partition:
*parted won't touch anything xfs-related
*cfdisk doesn't resize partitions
*PM 8 doesn't like my partition tables (and doesn't support xfs anyways)
*I can't figure out how to use fdisk
*xfs_growfs won't resize the partition for me
*backing up my entire root partition isn't really an option for me (no place to put it :cry: )

Does anyone know of a utility that will expand a partition with xfs on it without changing the starting block?
Back to top
View user's profile Send private message
dma
Guru
Guru


Joined: 31 Jan 2003
Posts: 437
Location: Charlotte, NC, USA

PostPosted: Sun Aug 24, 2003 3:30 am    Post subject: Reply with quote

If you don't change the starting block, you can just enlarge the partition and run:

Code:
xfs_growfs /dev/hdx1


I believe.
Back to top
View user's profile Send private message
PowerFactor
Veteran
Veteran


Joined: 30 Jan 2003
Posts: 1693
Location: out of it

PostPosted: Sun Aug 24, 2003 4:24 am    Post subject: Reply with quote

dma: You just skimmed his post didn't you. :lol:

kc8tbe: The only way I know of is with fdisk. So you'll have to figure it out. Its not really hard to use, just a little different interface. Just use m and p liberally. ;)

Fdisk doesn't actually resize partitions though. What you want to do is delete the partiton and create a new larger one with the exact same start point as the old one. Then you can use xfs_growfs.
Back to top
View user's profile Send private message
kc8tbe
Tux's lil' helper
Tux's lil' helper


Joined: 12 Aug 2003
Posts: 135
Location: Cleveland, OH USA

PostPosted: Sun Aug 24, 2003 1:25 pm    Post subject: Reply with quote

PowerFactor: Thanks so much for replying!

Unfortunately, fdisk is easy for you (because you already know how to use it!) but undecipherable for me. My fdisk help and info pages don't even have m or p as valid options!
Does anybody out there know of an fdisk tutorial written in English that can put be on the right track (no pun intended)?
Back to top
View user's profile Send private message
kc8tbe
Tux's lil' helper
Tux's lil' helper


Joined: 12 Aug 2003
Posts: 135
Location: Cleveland, OH USA

PostPosted: Thu Aug 28, 2003 11:35 pm    Post subject: Reply with quote

:D All right! I figured it out!
Unfortunately, "info fdisk" and "fdisk --help" don't mention all of fdisk's commands. To access these you must start fdisk "fdisk -l" and then enter "help" or "m". Here's how to expand an xfs partition with fdisk; I will assume that all partitions on the disk are primary (if not, you can still do it - figure it out yourself!):

1. Start fdisk. In my case, "fdisk /dev/hda" where /dev/hda is the device containing the partition you want to expand.
2. Enter "m" to get a list of possible fdisk commands. There is no need to turn on expert commands ("x").
3. Enter "p" to get a printout of your disk's partition table. Be sure to note the starting block of your xfs partition (in my case, 19), the number of the partition (in my case, /dev/hda2 or simply "2"), and the starting block of the next partition (in my case, 1726).
4. Delete the xfs partition. Do this by entering "d" and then, when prompted, the partition number (in my case, "2"). Don't worry, your changes won't be committed to disk until you enter "w".
5. Check your partition table again with "p".
6. Create a new partition by entering "n". You will be prompted for a starting block, ending block, and partition number. The starting block and partition number must be the same as for the recently deleted xfs partition or you will lose data!!! (In my case "19" and "2", respectively). The ending block can be any number bigger than what it was. To make the largest possible partition (probably what you are trying to do), use a number one less than the starting block of the next partition (in my case, 1726-1= "1725").
7. Check your partition table again with "p."
8. If all is well, commit changes and exit with "w". If you screwed up, use "q" to quit without saving.
9. You must now reboot so that your kernel will read the new partition table.
10. To make your xfs filesystem grow to use the space, use "xfs_growfs". "xfs_growfs -d -l -r /" will enlarge the data, log, and realtime sections of your xfs filesystem to the largest possible size (probably what you want) assuming that the mountpoint for said filesystem is "/". Otherwise, mount the file system (if it isn't already mounted) and replace "/" with the mountpoint. Yes, it is safe to do this to your root filesystem. If you get an error, try ommitting "-r" or "-l" or both as your filesystem may not have a realtime or log component. The command should not take very long to execute.
Good luck!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum