How to repair a corrupted flash drive

How to do things, solutions, recipes, tutorials
Message
Author
labbe5
Posts: 2159
Joined: Wed 13 Nov 2013, 14:26
Location: Canada

How to repair a corrupted flash drive

#1 Post by labbe5 »

sudo fsck /dev/sdcx

x being your partition number, and sdc your device (could be sdb, sdd, sde...).

This simple operation will remove bad file sectors on either a partition or the entire device.

When you want to nuke your device, and create a new data partition :

For ext4 :
sudo mkfs.ext4 -f /dev/sdc1 (sd... vary depending on your installation)

For Fat32:
sudo mkfs.msdos -f 32 /dev/sdc1 (same caveat for sd... )

Hopefully, your flash drive will work again.

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#2 Post by watchdog »

Some years ago I was compelled to flash the original firmware from windows to a broken usb stick.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#3 Post by Flash »

Sudo? What's that?

phat7
Posts: 179
Joined: Fri 05 Jun 2015, 08:54

#4 Post by phat7 »

You already have a thread. Why another one?
how to repair a corrupted USB flash drive

Why "Subject description: for Mintpup or Xenialdog"?

bigpup alread told you
bigpup wrote:In Your how to.
You can delete sudo in all the console commands.
Puppy is running as root.
You didn't respond. Do you follow your own threads?

Pelo

I use Windows 7 for repairing my USBs

#5 Post by Pelo »

I use Windows 7 for repairing my USBs. insert the defectuous one. Windows will ask you i you want to check it and repair. Efficient.

User avatar
drunkjedi
Posts: 882
Joined: Mon 25 May 2015, 02:50

#6 Post by drunkjedi »

LOL, Windows will try to repair quite good one too. Better backup your data.....

User avatar
Burn_IT
Posts: 3650
Joined: Sat 12 Aug 2006, 19:25
Location: Tamworth UK

#7 Post by Burn_IT »

No more of a problem than doing it in Linux.
It will NOT report an error unless there IS one so stop being melodramatic.
"Just think of it as leaving early to avoid the rush" - T Pratchett

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#8 Post by perdido »

I did not realise that windows now repairs ext1. ext2, ext3, ext4 file systems on a corrupted USB drive.

When did that start?

Pelo

i have none of these extensions

#9 Post by Pelo »

i have none of these extensions. Pendrive is FAT32 and puppies are used as frugal install
Post-scriptum : for Mintpup and XenialDog ??? sorry for disturb.. :?
Attachments
MyLinuxLive.jpg
checked to-night
(74.16 KiB) Downloaded 415 times
Last edited by Pelo on Sun 16 Oct 2016, 02:17, edited 1 time in total.

User avatar
Burn_IT
Posts: 3650
Joined: Sat 12 Aug 2006, 19:25
Location: Tamworth UK

#10 Post by Burn_IT »

In which case it is definitely going to be safer doing it in Windows since the Linux FAT32 support is based on ripped off code.
"Just think of it as leaving early to avoid the rush" - T Pratchett

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#11 Post by perdido »

Notwithstanding anyone's personal preferences, the following can be surmised from this thread.

EXT1, EXT2, EXT3, EXT4, NTFS, FAT32 can be repaired by Linux.

NTFS and FAT32 can be repaired by Windows.

User avatar
Burn_IT
Posts: 3650
Joined: Sat 12 Aug 2006, 19:25
Location: Tamworth UK

#12 Post by Burn_IT »

It is NOT safe repairing FAT32 and NTFS using Linux.
It can be done, but is not the safest way.
If you want an argument, all the EXTn extenion formatted drives can be repaired under Windows.

When are you people going to realise that Linux is NOT the be and end alll of OSs. Others do exist and many are better than Linux at doing specific things.
It is a case of horses for courses; use the better tool for the specific job, especially if there are problems.
"Just think of it as leaving early to avoid the rush" - T Pratchett

GoogleFactChecker
Posts: 4
Joined: Sat 15 Oct 2016, 23:16

#13 Post by GoogleFactChecker »

Burn_IT wrote:... since the Linux FAT32 support is based on ripped off code.
That's quite a hefty accusation. Proof?
Burn_IT wrote:It is NOT safe repairing FAT32 and NTFS using Linux.
It can be done, but is not the safest way.
We can understand NTFS cannot be safely repaired by Linux, but FAT32?
Proof?

rokytnji
Posts: 2262
Joined: Tue 20 Jan 2009, 15:54

#14 Post by rokytnji »

Good thing I never read this thread when repairing my sd card fat 32 puppeee frugal installs on my eeepc 701SD

http://murga-linux.com/puppy/viewtopic. ... 859#773859

Back when it would not boot because of improper unmount due to power failure <drained battery> or a brain fart and ejecting sd card too early.

I'd boot A live gparted session on a Puppy live usb just made for this repair . Run a check on unmounted puppeee sd card. Finish. Reboot.
Pull Puppy pendrive with gparted on it. Leave Puppeee sd card in. Done. Fixed.
Problem solved, Problem never mentioned.

Like I said. Good thing I did not find this thread earlier. :shock:

Pelo

I also have Puppy Rescue

#15 Post by Pelo »

I also have Puppy Rescue. for pendrives completely garbled, to trash definitively. To save some files, generally my pictures.

TyroBGinner
Posts: 236
Joined: Wed 30 Mar 2016, 20:18

#16 Post by TyroBGinner »

I thought that fsck and Microsoft programs like chkdsk "fixed" a filesystem by effectively erasing file clusters that were not associated with anything. There doesn't seem to be any provision for recovery. A real problem for a "defectuous" drive.

And is "Google Fact Checker" the reincarnation of lhtc?

Oh, and I almost forgot, Windows is better than Linux.

User avatar
Burn_IT
Posts: 3650
Joined: Sat 12 Aug 2006, 19:25
Location: Tamworth UK

#17 Post by Burn_IT »

... since the Linux FAT32 support is based on ripped off code.
Fat32 was designed and patented by MS and Linux was using it for years before they asked permission to use it. There was a huge fuss about it at the time and MS threatened to sue unless they asked.
They didn't want any money for it, they just wanted Linux to admit it in the license terms.

Why don't YOU look it up.
"Just think of it as leaving early to avoid the rush" - T Pratchett

GoogleFactChecker
Posts: 4
Joined: Sat 15 Oct 2016, 23:16

#18 Post by GoogleFactChecker »

Burn_IT wrote:
... since the Linux FAT32 support is based on ripped off code.
Fat32 was designed and patented by MS and Linux was using it for years before they asked permission to use it. There was a huge fuss about it at the time and MS threatened to sue unless they asked.
They didn't want any money for it, they just wanted Linux to admit it in the license terms.
1. This is not the same as "ripped off code".
2. Proof for what you said above?
Why don't YOU look it up.
You are the one who makes the claim, the burden of proof is on you.

Sailor Enceladus
Posts: 1543
Joined: Mon 22 Feb 2016, 19:43

#19 Post by Sailor Enceladus »

Speaking of "rip-offs", here's what Bill Gates himself has to say about Windows and Apple apparently :lol:

[quote]As Steve Jobs biography went OVERPRICED from today, Fortune magazine has got an exclusive reprint rights of part of the biography where the relationship between Steve Jobs and Bill Gates was discussed. In that, following is the situation when Steve Jobs came to know that Bill Gates at Microsoft is developing a competing OS and Bill Gates visits Apple’s campus to talk with Steve as per his request.

Their meeting was in Jobs’s conference room, where Gates found himself surrounded by ten Apple employees who were eager to watch their boss assail him. Jobs didn’t disappoint his troops. “You’re ripping us off!

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#20 Post by perdido »

Burn_IT wrote:
... since the Linux FAT32 support is based on ripped off code.
Fat32 was designed and patented by MS and Linux was using it for years before they asked permission to use it. There was a huge fuss about it at the time and MS threatened to sue unless they asked.
They didn't want any money for it, they just wanted Linux to admit it in the license terms.
Microsoft wanted money.
Microsoft sued TomTom because TT was using FAT32 in its devices and refused to pay money (licensing fees) to Microsoft. TomTom was using Linux in its GPS devices.

TomTom is now a member of the Open Inventions Network. The Open Inventions Network includes IBM, Novell, Philips, Red Hat,Sony. NEC, Google, Toyota, Canonical, and other major patent holders.

The Open Inventions Network is what keeps Microsoft from litigating everyone out of existence by the veiled threat of their own litigation against MS for the many thousands of patent infringements MS has commited against the members of The Open Inventions Network. Strength in numbers has neutered the bully.

Post Reply