Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: Files gone from USB after unmounting

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

    Re: Files gone from USB after unmounting

    I have an NTFS disk (really 1 partition that uses almost all the HDD) that gets corrupted by a video recording device about once every 3-4 weeks. The device splits the files every 2GB, so when the corrupted files begin it is very clear and I know it. Then I'll pull all the files I can off, there will be a few errors in the output from that attempt, and I'll know to reformat the HDD. I have a script to handle that and set a LABEL on it. Once my script formatted the wrong partition - discovered the EFI boot partition by accident and the next reboot was a bad day for me.
    Basically, it does this:
    Code:
    sudo mkntfs -Q -L 250G $DEV
    I've had problems with FAT32 storage becoming corrupted too - same video device. I have flash devices that have never been connected to that video recorder and those seldom, if ever, become corrupted.

    Seems really odd to need a Windows file system, but not have a Windows machine?

  2. #12
    Join Date
    Dec 2015
    Beans
    61

    Re: Files gone from USB after unmounting

    So I tried all kinds of things in Windows.

    I tried running chkdsk, formatting, cleaning the disk with diskpart which gave a strange error: "cannot zero sectors on disk."

    It seems for some reason it is write protected or the file system is otherwise corrupt. There is no switch to toggle on the device.

    I then tried a couple things with Ubuntu.

    I tried to format it to exfat with mkfs, tried to use wipefs, and tried to use fdisk to delete the partition on it and replace it with a new one.

    All proceeded without error, but to no effect, the existing files on the USB are still there.
    Last edited by robo731; July 16th, 2020 at 07:50 AM. Reason: Add troubleshooting steps taken in Ubuntu

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

    Re: Files gone from USB after unmounting

    Quote Originally Posted by robo731 View Post
    The options shown by mount all look good, they match what I expect.
    ARe they what a group of experts would expect?

    Quote Originally Posted by robo731 View Post
    I gave the configuration shared by TheFu a try, but no luck.

    Also tried mounting to /mnt.

    I do not eject, but I do umount.
    Please always say what "no luck" means, exactly. Is there an error message? If so, always post it using copy/paste.
    umount is better than eject, I usually type "sync" 3 times after, just in case.
    Using /mnt/ is better too, but shouldn't matter.

    Quote Originally Posted by robo731 View Post
    Unfortunately I do need to use this drive with Windows, so ext4 is not a good option. I'd like to leave formatting as a last resort.

    First I will try to repair the drive on Windows and report back.
    Seems you are at the Last Resort now. If it must be used with Windows, then I'd use exFAT today, assuming it is a flash drive. "USB" is vague. If it is an SSD or spinning HDD, then I'd use NTFS. You've never said what type of storage it is. Flash storage fails, sometimes much quicker than people expect, especially if used daily. The underlying technology used will determine if it lasts 4 months or 10 yrs. Give a hint, please. How old is this device?

  4. #14
    Join Date
    Dec 2015
    Beans
    61

    Re: Files gone from USB after unmounting

    Quote Originally Posted by TheFu View Post
    ARe they what a group of experts would expect?
    Ask and you shall receive.

    Code:
    /dev/sdb1 on /mnt type vfat (rw,nosuid,nodev,realtime,uid=1000,gid=1000,fmask=0002,dmask=0002,allow_utime=20,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
    For the record I also tried with errors=panic, but it did not panic.

    Quote Originally Posted by TheFu View Post
    Is there an error message? If so, always post it using copy/paste.
    Quote Originally Posted by robo731 View Post
    All proceeded without error
    Like I said no error messages are displayed I'm afraid.

    Quote Originally Posted by TheFu View Post
    Seems you are at the Last Resort now. If it must be used with Windows, then I'd use exFAT
    Indeed. Yes I am looking to use exFat.

    Quote Originally Posted by TheFu View Post
    How old is this device?
    It is maybe 2 to 3 months old and sees little usage, maybe once every two weeks on average, so I've been thinking this issue is not likely due to wear and tear.

    I suppose it's possible the hardware is faulty, but I'd like to exhaust all other options before resigning to such a conclusion.
    Last edited by robo731; July 16th, 2020 at 03:16 PM.

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

    Re: Files gone from USB after unmounting

    Quote Originally Posted by robo731 View Post
    It is maybe 2 to 3 months old and sees little usage, maybe once every two weeks on average, so I've been thinking this issue is not likely due to wear and tear.

    I suppose it's possible the hardware is faulty, but I'd like to exhaust all other options before resigning to such a conclusion.
    It could just be incompatible between the USB port/controller and the on-device electronics. I have a few "name brand" flash drives that don't work at all with the USB3 ports on 1 laptop, but work fine with the USB2 controller on that same laptop and every other USB2/3 port in the house.

    Is it a flash drive or something else? I may have missed that answer. "USB" is ambiguous.

  6. #16
    Join Date
    Dec 2015
    Beans
    61

    Re: Files gone from USB after unmounting

    Yeah, I've been thinking to try with the USB 2 port on the laptop. Have had issues in the past with bootable media on 3.0 ports.

    Sorry, I forgot to answer. Yes, it's a flashdrive.

  7. #17
    Join Date
    Dec 2015
    Beans
    61

    Re: Files gone from USB after unmounting

    I don't think it's related to this. I have also tried across different devices.

  8. #18
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Files gone from USB after unmounting

    It is possible that your USB flash drive is 'gridlocked', which means that the hardware is read-only, damaged beyond repair. Maybe you can still return it and get a replacement from the vendor.

    The following link may help you analyze the problem, and if you are lucky, solve it (if there is only 'confusion'),

    Analysis of the problem

  9. #19
    Join Date
    Dec 2015
    Beans
    61

    Re: Files gone from USB after unmounting

    Thanks, I had actually bookmarked that while I was searching.

    I'm going to give this a try first, if it doesn't work will try to follow that post.

  10. #20
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Files gone from USB after unmounting

    Interesting, this hdparm method is new to me. Thanks for the link

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

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
  •