[parted-devel] Deleting loop partition clears XFS signatures

Brian C. Lane bcl at redhat.com
Fri Feb 20 16:19:38 UTC 2015


On Fri, Feb 20, 2015 at 08:55:50AM +0000, Mike Fleetwood wrote:
> Hi,
> 
> I happened to look at this commit in parted:
>   libparted: don't trash filesystem when writing loop label
>   http://git.savannah.gnu.org/cgit/parted.git/commit/?id=1be70093eb937f34388e06ce3731e5f56f217950
> 
> It tries to avoid stomping on the super block of whole disk file systems
> when the virtual partition covering the whole disk is deleted.  It
> writes just the loop signature "GNU Parted Loopback 0" at byte offset 0
> on the disk.  However the XFS super block and it's signature start at
> byte offset 0 too, so this renders the XFS file system undetectable,
> effectively deleting it.
> 
> With a whole disk ext4 file system, deleting the virtual partition is
> effectively a no-operation as the ext4 file system remains intact and is
> still detected on the whole disk device.
> 
> It appears that deletion of the virtual loop partition is trying to be
> as close as possible a no-operation, yet still leave the device detected
> with a loop partition table.  So either: 1) the device contains the
> loop signature or 2) contains a libparted recognised file system
> signature.  In both cases it will still be recognised as containing a
> loop partition table when re-read.  If something else erases the
> signature in the mean time then that is something else's responsibility
> and a new loop partition table can be re-created.  Therefore I think
> deletion of the virtual loop partition table should truly be a
> no-operation.

What do you expect to happen though? You've explicitly told parted to
remove the 'partition' and that's what's happened. The fact that ext4
survives is more of an accident than anything else. I also don't really
see the utility of trying to use parted like this -- just make a real
disk label and use that.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)



More information about the parted-devel mailing list