I Need A Command To Repair a USB Drive

Online now: Google [Bot], Majestic-12 [Bot]
Post Reply
Pariah Know Your Enemy
User avatar
We had a power outage yesterday and one of my Thumb drives remounted all stick fiddled up. Sometimes it mounts read only, the next time file contents cannot be read at all. Seems to be random each time I mount and unmount it. I have managed to copy off most of the files on it and it would not be a disaster if I couldn't but I would prefer to recover them if I can.
I want to run fsck or ckdsk or whater the fiddlesticks on this drive but after minutes of searching couldn't find the command that fits my scenario. So I figured I'd ask you smart people.
Here are the particulars: 32GB thumb drive formatted xfat located at sde1.
May I please have some yummy copy/pasta to try and fix this drive?

Follow up question, I have had this happen before using xfat, would formatting the drive in ntsf be the smarter way to go as far as fault resistance goes?
dv
User avatar
xfat is... not a thing? Do you mean ExFAT?

If so, NTFS would be better. There's no journaling or stuff in exFAT, so if it's corrupted you're pretty much stuck.
Pariah Know Your Enemy
User avatar
dv posted:
xfat is... not a thing? Do you mean ExFAT?

If so, NTFS would be better. There's no journaling or stuff in exFAT, so if it's corrupted you're pretty much stuck.

Doh...vfat. :heh:

Might I be better off booting into Win7 and fixing it from there? Formatting to ntfs is still kinda wonky in Linux so doing all of this on Windows might be the way to go?
Anyway, that is an option.
dv
User avatar
Pariah posted:
dv posted:
xfat is... not a thing? Do you mean ExFAT?

If so, NTFS would be better. There's no journaling or stuff in exFAT, so if it's corrupted you're pretty much stuck.

Doh...vfat. :heh:

Might I be better off booting into Win7 and fixing it from there? Formatting to ntfs is still kinda wonky in Linux so doing all of this on Windows might be the way to go?
Anyway, that is an option.


Yeah - you're going to have more options and better tools on a Windows system for this.
Pariah Know Your Enemy
User avatar
dv posted:
Pariah posted:
dv posted:
xfat is... not a thing? Do you mean ExFAT?

If so, NTFS would be better. There's no journaling or stuff in exFAT, so if it's corrupted you're pretty much stuck.

Doh...vfat. :heh:

Might I be better off booting into Win7 and fixing it from there? Formatting to ntfs is still kinda wonky in Linux so doing all of this on Windows might be the way to go?
Anyway, that is an option.


Yeah - you're going to have more options and better tools on a Windows system for this.

Ya, I think I will do that. I just did this:

Code:
sudo umount /dev/sdd1

sudo dosfsck -a /dev/sdd1


Which did things but then:

Image

I have 5 thumb drives, all different colors and I name them the color that they are.
It might just be dead. I've had a couple flash drives act like that and no matter how many times I reformatted it (if the reformatting didn't outright fail) it was still useless.
Pariah Know Your Enemy
User avatar
Betonhaus posted:
It might just be dead. I've had a couple flash drives act like that and no matter how many times I reformatted it (if the reformatting didn't outright fail) it was still useless.

I just said "fuckit" and reformatted it, this time ntsf. Honestly I don't know why I didn't use ntfs in the first place. I was formatting all 5 drives when I first got them and I guess I got lazy and just used default settings.

The drive seems to be functional again.
Pariah posted:
Betonhaus posted:
It might just be dead. I've had a couple flash drives act like that and no matter how many times I reformatted it (if the reformatting didn't outright fail) it was still useless.

I just said "fuckit" and reformatted it, this time ntsf. Honestly I don't know why I didn't use ntfs in the first place. I was formatting all 5 drives when I first got them and I guess I got lazy and just used default settings.

The drive seems to be functional again.

copy files to it until it is full then copy them back again. If that fails it's toast.
dv posted:
xfat is... not a thing? Do you mean ExFAT?

If so, NTFS would be better. There's no journaling or stuff in exFAT, so if it's corrupted you're pretty much stuck.

exFAT is still a better option than old school FAT, right?
dv
User avatar
macaddict4life posted:
dv posted:
xfat is... not a thing? Do you mean ExFAT?

If so, NTFS would be better. There's no journaling or stuff in exFAT, so if it's corrupted you're pretty much stuck.

exFAT is still a better option than old school FAT, right?


Probably, but "better" is relative. Journaling is one of the main things giving more modern file systems more crash recovery capability.

I'm pretty sure exFAT was just FAT plus some other bits to reduce the likelihood of erasing your flash drive when you unplug it too fast. Microsoft developed it and only really pushes it for USB drives and removable storage.
Pariah Know Your Enemy
User avatar
dv posted:
macaddict4life posted:
dv posted:
xfat is... not a thing? Do you mean ExFAT?

If so, NTFS would be better. There's no journaling or stuff in exFAT, so if it's corrupted you're pretty much stuck.

exFAT is still a better option than old school FAT, right?


Probably, but "better" is relative. Journaling is one of the main things giving more modern file systems more crash recovery capability.

I'm pretty sure exFAT was just FAT plus some other bits to reduce the likelihood of erasing your flash drive when you unplug it too fast. Microsoft developed it and only really pushes it for USB drives and removable storage.

Seems like Linux Mint prefers vFAT for thumb drives.
maurvir Steamed meat popsicle
User avatar
Isn't ExFAT still patent encumbered? I don't know if that was among the patents MS handed over or not, but that might explain the lack of native support in Linux.
Pariah Know Your Enemy
User avatar
maurvir posted:
Isn't ExFAT still patent encumbered? I don't know if that was among the patents MS handed over or not, but that might explain the lack of native support in Linux.

Looks like exFAT may be encumbered.
I just fired up gParted and looked at the list of supported file systems and on exFAT the only thing gParted can do is copy files off. It cannot create an exFAT partition or any other operation.
Thought ExFAT was able to handle bigger file sizes; but pretty much the same as FAT. NTFS would be great if MacOS could natively write to it.
Pariah Know Your Enemy
User avatar
avkills posted:
Thought ExFAT was able to handle bigger file sizes; but pretty much the same as FAT. NTFS would be great if MacOS could natively write to it.

I think it is accurate to say that exFAT is to FAT as HFS+ is to HFS. Different changes but just as trivial. Just like HFS+, exFAT sucks pretty much as bad as FAT, just in a slightly different way.
avkills posted:
Thought ExFAT was able to handle bigger file sizes; but pretty much the same as FAT. NTFS would be great if MacOS could natively write to it.

Can't you just install a ntfs driver in macOS? I've installed a hfs driver in windows a couple times to salvage a backup.
Betonhaus posted:
avkills posted:
Thought ExFAT was able to handle bigger file sizes; but pretty much the same as FAT. NTFS would be great if MacOS could natively write to it.

Can't you just install a ntfs driver in macOS? I've installed a hfs driver in windows a couple times to salvage a backup.


Of course, but you have to pay for it if you want one that is good.
Dan Airman Dan
User avatar
Betonhaus posted:
Pariah posted:
Betonhaus posted:
It might just be dead. I've had a couple flash drives act like that and no matter how many times I reformatted it (if the reformatting didn't outright fail) it was still useless.

I just said "fuckit" and reformatted it, this time ntsf. Honestly I don't know why I didn't use ntfs in the first place. I was formatting all 5 drives when I first got them and I guess I got lazy and just used default settings.

The drive seems to be functional again.

copy files to it until it is full then copy them back again. If that fails it's toast.

Make sure you do this, Par. Once a flash drive starts to go, the rest of it is usually about to jump the shark too. This will tell you if you just had filesystem corruption as opposed to the hardware going kaput. Your description of it kind of leans toward the latter.
Pariah Know Your Enemy
User avatar
Dan posted:
Betonhaus posted:
Pariah posted:
Betonhaus posted:
It might just be dead. I've had a couple flash drives act like that and no matter how many times I reformatted it (if the reformatting didn't outright fail) it was still useless.

I just said "fuckit" and reformatted it, this time ntsf. Honestly I don't know why I didn't use ntfs in the first place. I was formatting all 5 drives when I first got them and I guess I got lazy and just used default settings.

The drive seems to be functional again.

copy files to it until it is full then copy them back again. If that fails it's toast.

Make sure you do this, Par. Once a flash drive starts to go, the rest of it is usually about to jump the shark too. This will tell you if you just had filesystem corruption as opposed to the hardware going kaput. Your description of it kind of leans toward the latter.

Ya, but the way it happened after a power-outage caused a hard unmount points towards data structure corruption.
Dan Airman Dan
User avatar
Yes and no. A corrupt directory will struggle with the same files on the volume every time. A corrupt filesystem will struggle to mount, but will usually behave normally once wrangled online. Failing storage will give you a random mix of both, which sounds like what you were experiencing.
Subsequent topic  /  Preceding topic
Post Reply

I Need A Command To Repair a USB Drive