# USB flash drive wasn't properly unmounted



## S4m_Leet (Feb 20, 2010)

Hi all!

I turned off my computer (using shutdown -p NOW) while USB flash card with msdosfs was mounted. Now there is corrupted data on flash card. Some files has names like 2??Ð½<b??.Ñ—Ñ‰Ñˆ and zero length. Some directories became a files. Name and size of some files looks OK, but files has corrupted data.
WTF? Why didn't our favorite OS umount all mounted fs correctly? What should I do with my data on flash?

I was trying fsck but it didn't help:

```
#fsck_msdosfs /media
** /media (NO WRITE)
Invalid signature in boot block: 171f
```

Thank you for your answers.


----------



## Speedy (Feb 20, 2010)

Don't know if your stick is recoverable, but you certainly don't do it right. (fsck_msdosfs /media)
You are supposed to run fsck on an unmounted filesystem.


----------



## S4m_Leet (Feb 20, 2010)

*Speedy*,
Tnx for the answer. I was trying that too: 

```
#fsck /dev/da0
fsck: Could not determine filesystem type
#fsck_msdosfs /dev/da0
** /dev/da0
Invalid sector size: 1766
```
Don't care about this data too much (but it would be good to recover). It's really sad FreeBSD looks so unreliable with USB stick.


----------



## S4m_Leet (Feb 20, 2010)

"fsck_msdosfs -y /dev/da0s1" made some modifications to fs but date still unavailable, don't see any chages.


----------



## Speedy (Feb 20, 2010)

Sorry, can't help much ...

To restore damaged/lost partitions - testdisk
To recover files - photorec


----------



## lme@ (Feb 22, 2010)

Try do run chkdisk on Windows.


----------



## S4m_Leet (Feb 22, 2010)

Unfortunately, I've no Windows, so I made newfs_msdos.
Thanks for the answers.


----------

