BLU Discuss list archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss] Recovering a corrupted usb hard drive with XFS
- Subject: [Discuss] Recovering a corrupted usb hard drive with XFS
- From: worley at alum.mit.edu (Dale R. Worley)
- Date: Wed, 15 May 2024 11:50:43 -0400
- In-reply-to: <mailman.1175.1715700554.30041.discuss@driftwood.blu.org> (discuss-request@driftwood.blu.org)
> 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
- Follow-Ups:
- [Discuss] Recovering a corrupted usb hard drive with XFS
- From: abreauj at gmail.com (John Abreau)
- [Discuss] Recovering a corrupted usb hard drive with XFS
- Prev by Date: [Discuss] Boston Linux VIRTUAL Meeting , reminder, tomorrow, Wednesday, May 15, 2024 - Fotocx 2024
- Next by Date: [Discuss] discuss@lists.blu.org unsubscribed
- Previous by thread: [Discuss] Recovering a corrupted usb hard drive with XFS
- Next by thread: [Discuss] Recovering a corrupted usb hard drive with XFS
- Index(es):