Re: Using xfs_growfs on a single disc

From: Tony 'Nicoya' Mantler (nicoya_at_ubb.ca)
Date: 10/06/04


Date: Tue, 05 Oct 2004 22:31:50 GMT

In article <ccef0fdf.0410051400.4e148fba@posting.google.com>,
 rupert@heesom.org.uk (Rhubear) wrote:

: I have migrated an existing partition to a larger disk and now want to
: enlarge the existing partition to take up all the disk space.
:
: The FDISK output of my disk looks like:
:
: Disk /dev/hda: 81.9 GB, 81964302336 bytes
: 255 heads, 63 sectors/track, 9964 cylinders
: Units = cylinders of 16065 * 512 = 8225280 bytes
:
: Device Boot Start End Blocks Id System
: /dev/hda1 * 1 6 48163+ 83 Linux
: /dev/hda2 7 1116 8916075 5 Extended
: /dev/hda5 7 1038 8289508+ 83 Linux
: /dev/hda6 1039 1116 626503+ 82 Linux swap
:
:
: Entries from my /etc/fstab are:
:
: /dev/hda5 / xfs defaults 1 1
: /dev/hda1 /boot ext2 defaults 1 2
: /dev/hda6 swap swap defaults 0 0
:
: I understand from the docs I've read that before I can use xfs_growfs
: that I need to enlarge the partition. In the past I've enlarged
: partitions with FAT32, NTFS, ext2 using Partition Magic.
:
: How do I enlarge a parition for XFS? Do I need to use LVM even if I
: am not dealing with a parition spanning multiple disks?
:
: Also, I've been reading that the Root partition (my /dev/hda5) should
: not be XFS and cannot be enlarged. This suggests that I need to
: redesign my partitioning system.
:
: I want to use Software RAID using md to mirror 2 discs with whatever
: partition structure is needed, also would like the flexability of
: adding disc space later using more pairs of mirrored disks. Thus I
: would probably need to use LVM for the disc management. Do I need to
: use LVM straight away for the immediate task?

Ideally you would have used xfs_copy or xfsdump/xfsrestore to move the
filesystem, rather than just dding the old harddrive to the new (which I assume
is what you did). This would eliminate the need to run xfs_growfs.

You'll want to delete the old partition (as well as your swap partition, as it's
in the way) and re-create it again with the exact same starting block and the
ending block wherever you like, assumably somewhere near the new end-of-disk.

You'll then re-mount the filesystem (since it's / that probably means a reboot)
and run "xfs_growfs /" and it should just magically figure itself out.

Of course, you'll want to have recent verified backups on hand in case things
don't work quite right. If it complains about operating on /, you may need to do
some operations while booted from a livecd.

I run XFS for all my partitions in linux (even without a seperate /boot
partition) and I have yet to run into any issues. I have not yet had the need to
run xfs_growfs, though, as I have done my copying using xfsdump/xfsrestore.

Cheers - Tony 'Nicoya' Mantler :)

-- 
Tony 'Nicoya' Mantler -- Master of Code-fu -- nicoya@ubb.ca
--  http://nicoya.feline.pp.se/  --  http://www.ubb.ca/  --


Relevant Pages

  • Re: Boot Problem
    ... On rebooting, Disc Director auto starts. ... I have managed to successfully copy by DELETING partition, ... Check previous disk edit. ... I ensure all OK by swapping over drives. ...
    (microsoft.public.windowsxp.hardware)
  • Re: Linux community software-update-anarchy polemic
    ... Remember, I'm just a monkey. ... That implies that if you have one disk per partition, ... Trust the kernel or don't trust the kernel, but either way, both ...
    (comp.os.linux.misc)
  • Re: Xp embedded in C:
    ... disc with a single partition I am copying all the archives of 1-7. ... > sure that if using FAT32 to run bootprep.exe from DOS to prepare the disk ...
    (microsoft.public.windowsxp.embedded)
  • SUMMARY: Moving /usr From Under Root "/" To Its Own Partition
    ... One of the reasons for doing this is to end up with a smaller root ... Install the boot block and boot off the new drive. ... " In order for the root partition to be fscked and remounted ... D> temporarily on the existing disk. ...
    (SunManagers)
  • Re: Two "expert" issues I must solve before upgading
    ... I think backups are different than the other fluff you suggest - more ... out there who had a disk crash and had to start from scratch. ... >image of your current Windows 98 OS partition. ... you can restore the disk image and get back quickly ...
    (microsoft.public.windowsxp.newusers)

Quantcast