The fdasd partitioning tool only alters the disk's partition table, which
is outside of the partition being resized - making it suitable for
extending a partition (assuming there is free formatted space after it) or
shrinking a partition (assuming you have already shrunk the filesystem
within it).

...I've done this myself on quite a few occasions, so I can attest to it
working in practice as well as theory.

The OP's issue was that the disk he was formatted beyond the existing
partition.

As has been mentioned already, in the odd case where a file-based tool like
`cp -a` or `rsync` doesn't work according to expectation (because of a
special filesystem feature they don't fully replicate, or a dependency on
things like UUIDs or volume labels that wouldn't get copied along with the
files), a `dd` copy could be used to copy the existing file system into a
new partition - followed by a filesystem check and resize2fs (or other such
file-system-appropriate resizing tool) to expand the filesystem to fill the
new partition.

On Sat, Mar 31, 2012 at 6:01 PM, Stephen Powell <[email protected]>wrote:

> On Sat, 31 Mar 2012 10:46:10 -0400 (EDT), Stephen Powell wrote:
> >
> > Note that, in theory, fdasd could be used, rather than parted, to
> > create, delete, then re-create the partition at a larger size,
> > provided that fdasd doesn't write anything to the partition when
> > it deletes it.  I don't know enough about fdasd to know if that is
> > the case.  The old MSDOS fdisk program was known to write out a
> > few blocks of binary zeros to the beginning of a partition when
> > it deleted it.  This, of course, destroys the usability of the data
> > in the partition.  I know that parted does not do this.
>
> Oops!  I was wrong.  The old MSDOS fdisk program did not write out
> a few blocks of binary zeros to the beginning of a partition when
> it deleted it.  It did so when it allocated a new partition, to make
> it appear unformatted, even if that space was formerly occupied by
> another partition.  But the result is the same.  If you delete a
> partition and then re-create it at the same location, at the same
> size or with a different size, you lose access to the data which
> was formerly stored there.  My main point remains intact.  It is
> important to use a partitioning tool which does not write
> ANYTHING to the partition, either when deleting it or when creating
> it.  I do not know enough about fdasd to know if it meets those
> qualifications.  I do that that parted does meet those qualifications.
>
> By the way, I tend to use CMS RESERVED minidisks, rather than
> CDL-formatted minidisks; so that I can use the DIAG driver.
> Therefore, I don't have the option of resizing a partition in place.
> I have always used "cp" to copy the data between partitions,
> and I have never had any problems with symbolic links.
> Assume that the old extent is /dev/dasde1 and the new extent
> is /dev/dasdh1.  I use a procedure something like this to copy
> the data:
>
>   mount -r /dev/dasde1 /media
>   mount /dev/dasdh1 /mnt
>   cp -a /media/. /mnt
>   umount /mnt
>   umount /media
>
> I do this from another Linux virtual machine, of course, with
> the target machine down and logged off.  Symbolic links
> come through as symbolic links, not as files.  Of course, there
> are "gotchas" that you need to watch out for.  If the new extent
> has a different UUID, you will need to adjust some files, such
> as /etc/fstab, etc.  And the boot partition requires special
> processing (i.e. run zipl in a chroot environment).  But the
> point is that I've never had any trouble with symbolic links.
>
> --
>  .''`.     Stephen Powell
>  : :'  :
>  `. `'`
>   `-
>
> ----------------------------------------------------------------------
> For LINUX-390 subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO LINUX-390 or
> visit
> http://www.marist.edu/htbin/wlvindex?LINUX-390
> ----------------------------------------------------------------------
> For more information on Linux on System z, visit
> http://wiki.linuxvm.org/
>

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/

Reply via email to