[Discuss] Recovering a corrupted usb hard drive with XFS

John Abreau abreauj at gmail.com
Wed May 15 18:44:21 EDT 2024


Not sure why we're still beating this dead horse, but that's just not the
case. When I formatted the drive, I formatted sdx1.

It's not a matter of opinion, nor is it a subject for voting to decide what
happened.

The 18TB disk is the largest disk I own, and all my other disks were close
to full when I purchased the 18TB disk. To back it up, I'd need to purchase
yet another disk, and I don't plan on doing that for at least another year.
More precisely, when the 18TB drive is getting close to full.




On Wed, May 15, 2024 at 11:52 AM Dale R. Worley <worley at alum.mit.edu> wrote:

> > From: John Abreau <abreauj at gmail.com>
>
> > I have an 18TB external hard drive that recently suffered a loss. When I
> > first set it up, I formatted it as a single partition with an xfs
> > filesystem.
>
> From the messages, I tend to agree with Gregory Galperin that you
> accidentally formatted sdx rather than sdx1, and then repeated using sdx
> rather than sdx1 when you mounted it.  In particular, you saw this
> peculiar situation before *before* running xfs_repair:
>
> > /dev/sdf exists, but /dev/sdf1 does not.
>
> That indicates that at that point, the kernel couldn't see a partition
> table.  And then fdisk reports that the disk starts with an XFS
> signature:
>
> > When I ran fdisk to examine the drive, it gave the following error:
> >
> > Welcome to fdisk (util-linux 2.39.4).
> >> Changes will remain in memory only, until you decide to write them.
> >> Be careful before using the write command.
> >
> >> The device contains 'xfs' signature and it will be removed by a write
> >> command. See fdisk(8) man page and --wipe option for more details.
>
> Though that doesn't solve the problem.  It seems like you need to verify
> the size of the filesystem, shrink it if necessary, then shift it later
> on the disk, then insert a GPT before the filesystem.  In a perfect
> world, GParted could do this but I don't know if it can.  I managed to
> find these with the query "use gparted to add a partition table to a
> disk that doesn't have one site:superuser.com":
>
>
> https://superuser.com/questions/1633123/how-to-partition-a-drive-that-has-no-partition-table-without-formatting
>
> https://superuser.com/questions/1200128/how-to-create-a-partition-table-on-a-drive-with-a-file-system-occupying-the-whol
>
> https://superuser.com/questions/1650509/add-gpt-to-disk-that-has-bare-ext4-file-system-without-data-loss
>
> In principal, it can be done by:  (1) using the right utility to shrink
> the filesystem enough to leave space for the GPT, (2) copying the
> filesystem "further" into the disk by that amount (which mostly has to
> be done *in reverse* to not lose data, so it can't be done directly by
> dd), (3) creating the GPT, (4) inserting a partition entry that
> describes the existing filesystem.
>
> If you can back up the disk to somewhere, wiping the disk and rebuilding
> it is going to be easier and safer.
>
> Dale
> _______________________________________________
> Discuss mailing list
> Discuss at driftwood.blu.org
> https://driftwood.blu.org/mailman/listinfo/discuss
>


-- 
John Abreau / Executive Director, Boston Linux & Unix
Email: abreauj at gmail.com / WWW http://www.abreau.net / PGP-Key-ID 0x920063C6
PGP-Key-Fingerprint A5AD 6BE1 FEFE 8E4F 5C23  C2D0 E885 E17C 9200 63C6


More information about the Discuss mailing list