Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Data drive erased?

  1. #1
    Join Date
    Mar 2009
    Location
    Sacramento, CA
    Beans
    594
    Distro
    Xubuntu

    Data drive erased?

    I recently moved my data drive's mount point in fstab from ~/Storage to /media/Storage. Then yesterday morning I was modifying my backup script, which copies files and folders from Storage to an ext4 partition on a 4TB portable drive. Suddenly and without notice, the Storage drive disappeared. No error message, except Audacious complaining that it couldn't find my music files any more. Storage was gone. A reboot didn't fix anything.

    I shut down and removed the storage drive (an HDD formatted ext4) and booted again, with just the boot drive (SSD). Now Linux boots, but it drops me to a CLI so I guess something's wrong with the desktop environment. I'm working on that in another thread.

    Plugging the storage drive into a USB enclosure, my Xubuntu laptop doesn't see the drive at all. Yet oddly, if I take the drive & enclosure to a Windows machine with Ext2 Volume Manager installed, it can see the drive, but it says it's completely empty. Uh oh.

    Unfortunately I'm having some (probably related) weirdnesses with the portable drive, so my recent backups seem to be gone as well. I have an offsite backup, but restoring from a months-old backup isn't an attractive idea. Are there any tricks to maybe recover my data from the storage drive?

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Data drive erased?

    I'd check the partitions and fstab entry first. A simple typo is most likely.

    https://help.ubuntu.com/community/DataRecovery This is a last-ditch method and shouldn't be expected to work.

    Loosing the primary and backup storage in the same week is really odd. Something about the process is wrong if that can happen.

    For the fstab, I much prefer to use LABELs, not devices or UUIDs, unless I'm using LVM, then I'll use the /dev/{vgname}/{lvname} mapper generated link, since it provides the most useful information for me.

  3. #3
    Join Date
    Mar 2009
    Location
    Sacramento, CA
    Beans
    594
    Distro
    Xubuntu

    Re: Data drive erased?

    There is some weirdness with the backup drive - In Windows with Ext2VM I can open and see my files, but my Linux laptop doesn't see the drive. The main problem, really, is that my backups had been missing the data from my storage drive because I had moved its mount point. That's really a 10T error on my part, but I was trying to fix the script when this crash happened.

    The thing is, I should be able to read the drive on another computer - I put it in a USB enclosure and plugged it into my laptop; it should have mounted the drive, but instead it pretends it can't see it. Now I just plugged it into a Linux laptop here at the office. It sees the drive and mounts it, but it shows as being empty.

    I've installed ddrescue, but it keeps erroring out when I try to recover my data to an empty portable drive. I must be doing this wrong.
    sudo ddrescue /media/leon/Storage /media/leon/BSA02407 ~/log.txt

    ddrescue: Output file exists and is not a regular file.
    ddrescue: Use '--force' if you really want to overwrite it, but be aware that all existing data in the output file will be lost.
    Try 'ddrescue --help' for more information.
    Last edited by peyre; October 17th, 2022 at 07:05 PM.

  4. #4
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Data drive erased?

    MS-Windows doesn't correctly un-mount file systems. Could that be the problem? Ensure fast startup is disabled in MS-Windows.

    I'd never use MS-Windows to directly mount non-Windows file systems, especially since any "try ubuntu" flash installer can do it easily.

  5. #5
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Data drive erased?

    Quote Originally Posted by peyre View Post
    sudo ddrescue /media/leon/Storage /media/leon/BSA02407 ~/log.txt
    Typically, ddrescue points at the device file, not the files inside a file system. It is best used with both those devices not mounted.

    Also, you cannot write to a log file anywhere in the source or target storage devices.

    Be certain to seem my other post above.

  6. #6
    Join Date
    Mar 2009
    Location
    Sacramento, CA
    Beans
    594
    Distro
    Xubuntu

    Re: Data drive erased?

    I plugged in the storage drive, unmounted it, and rerun sudo ddrescue /media/leon/Storage /media/leon/BSA02515 ~/log.txt, but it returns the same error. What am I doing wrong?

    As you can see, I'm not pointing to individual files.

  7. #7
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Data drive erased?

    Use the device file, not the mount location. I don't have time to explain what that means, but device files are in /dev/ 99.9% of the time. Be very careful, since picking the wrong one can be terrible and clearly won't do what you want.
    You'll need to understand the difference between the whole drive device, the partition devices and any specific volume manager devices. The source and the target don't need to be the same type of devices, but for a beginner, it is strongly recommended they are.

    https://en.wikipedia.org/wiki/Device_file has an overview, but talks about all the device files for many different OSes, not just storage. It could be confusing. The "Naming Convention" section should be helpful.

    https://tldp.org/HOWTO/Partition/devices.html is a little dated, but still relevant. Probably just ignore the "/dev/hd" stuff. May want to read up on partitions, since that is probably the level you want to work in doing ddrescue, but the level you want is completely up to you. ddrescue is dumb. It copies bits from A ---> B. That's it. The human typing the commands needs to ensure that "A" and "B" are appropriate for the desired task. The computer can't tell if the command it stupid or genius .... sometimes both. Copying bits from A-->B is very powerful, since we can copy from a device to a normal file or from a normal file into a device. We can copy from a whole drive device into a file or a partition too. Very powerful, but only if you understand why those things can be useful.

    Since you never shared the fstab, I cannot guess what the device file is. You've only said what the mount point for the file system was. That isn't the same thing.

  8. #8
    Join Date
    Mar 2009
    Location
    Sacramento, CA
    Beans
    594
    Distro
    Xubuntu

    Re: Data drive erased?

    Oh! I see. Well, to find the device file, I should be able to use gparted, I would think. It shows them as /dev/sda, /dev/sdb, etc. Does that sound right?

    I haven't included my fstab partly because I don't see how it could be the source of the problem--since the issue started during a session, and the drive shows blank when I hook it up to other machines via an enclosure.

  9. #9
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Data drive erased?

    Quote Originally Posted by peyre View Post
    Oh! I see. Well, to find the device file, I should be able to use gparted, I would think. It shows them as /dev/sda, /dev/sdb, etc. Does that sound right?

    I haven't included my fstab partly because I don't see how it could be the source of the problem--since the issue started during a session, and the drive shows blank when I hook it up to other machines via an enclosure.
    NO. Probably NOT what you want, but I don't know. Again, it could be genius or stupid. I cannot tell, but I'm leaning towards "stupid" now. BTW, I learned the difference the hard way myself - wiping an entire drive when that wasn't my intent.

    Learn what device files map to which devices BEFORE you make mistakes.

    Of course, if you just want to wipe the entire drive, that's easier. Use /dev/zero as the source/input device file. But that probably isn't what you really want, is it?

    Is the fstab some super secret thing to be hidden? I'm happy to post mine, but doubt they'd be useful, since I use LVM and my device file names are completely different from what is on your system(s), I suspect.

  10. #10
    Join Date
    Mar 2009
    Location
    Sacramento, CA
    Beans
    594
    Distro
    Xubuntu

    Re: Data drive erased?

    No, there's no secret to my fstab - it's just that it's at home, not here. I'll bring it in tomorrow morning.

    I've used the /dev/sd* information from gparted to successfully shred USB drives we needed securely wiped. Seemed like that would work for this as well--but, I guess not.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •