You are not logged in.

#1 2016-05-26 19:55:32

andros705
Member
Registered: 2016-05-12
Posts: 24

dd command and broken usb flash drive

Hi
Today I tried to burn windows7 iso to my usb flash drive using dd command:
dd bs=4M if=/home/user/iso/windows7.iso of=/dev/sdb status=progress && sync

Well i am pretty sure this broke down my pendrive, if I try to start GParted it stuck on loading screen and don't load up until I remove flash drive from computer.
I tried "parted /dev/sdb" but I have the same effect, it stuck and don't show anything.

lsblk gives me that:

sdb      8:16   1   7,2G  0 disk 
└─sdb1   8:17   1   7,2G  0 part

I also tried to format flash drive using windows but windows only crashes, I see blue screen and unreadable error codes.
Before using "dd" everything worked fine.

Last edited by andros705 (2016-05-26 20:06:56)

Offline

#2 2016-05-26 20:07:45

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,679
Website

Re: dd command and broken usb flash drive

andros705 wrote:

Today I tried to burn windows7 iso to my usb flash drive using dd command

Yeah, that doesn't work big_smile

See https://serverfault.com/questions/6714/ … from-linux

Have you tried clearing the MBR on the USB stick?

# dd if=/dev/zero of=/dev/sdb bs=512 count=1

Offline

#3 2016-05-26 20:18:49

andros705
Member
Registered: 2016-05-12
Posts: 24

Re: dd command and broken usb flash drive

Yes I tried dd if=/dev/zero It don't seem to work.
I tried to mount usb drive but get following error:
LC_ALL=C mount /dev/sdb1 /mnt/usb/

ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024   usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024   usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024   usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024   usa_ofs: 0  usa_count: 65535: Invalid argument
$MFTMirr does not match $MFT (record 0).
Failed to mount '/dev/sdb1': Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.

Last edited by andros705 (2016-05-26 20:19:10)

Offline

#4 2016-05-26 20:21:23

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,679
Website

Re: dd command and broken usb flash drive

andros705 wrote:

Yes I tried dd if=/dev/zero It don't seem to work.

https://bbs.archlinux.org/viewtopic.php?id=57855

I take it that you mean the command just freezes with no output?

Do you have access to a Windows machine upon which you could enact the suggested repair technique?

Offline

#5 2016-05-26 20:27:05

andros705
Member
Registered: 2016-05-12
Posts: 24

Re: dd command and broken usb flash drive

Head_on_a_Stick wrote:

I take it that you mean the command just freezes with no output?

No
The output is:

1+0 records in
1+0 records out
512 bytes copied, 40.2579 s, 0.0 kB/s

I meant that I doesn't change anything.
I have windows10 on different partition, I can boot it and try these suggestions but my windows is very slow so I will be in 10-15 minutes back.

Offline

#6 2016-05-26 22:00:59

andros705
Member
Registered: 2016-05-12
Posts: 24

Re: dd command and broken usb flash drive

Well I have tried the windows option but it did't work.

C:\Windows\system32>chkdsk /f G:
The type of the file system is NTFS.

Stage 1: Examining basic file system structure ...
  65 file records processed.
File verification completed.

I also tried "chkdsk G:/r" and "chkdsk G:"
That last one said that there are problems with sectors on my pendrive but it cannot repair it in read-only mode, I switched windows into recovery mode and tried to repair it from there, but no difference.

Last edited by andros705 (2016-05-26 22:01:40)

Offline

#7 2016-05-27 18:22:59

teckk
Member
Registered: 2013-02-21
Posts: 518

Re: dd command and broken usb flash drive

Look at ntfsprogs, see if they will help.

pacman -Si ntfs-3g
......
http://www.tuxera.com/community/open-source-ntfs-3g/

man ntfsprogs
man ntfsfix

Offline

#8 2016-05-27 18:42:13

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: dd command and broken usb flash drive

andros705 wrote:

That last one said that there are problems with sectors on my pendrive

Not sure what it means, is it possible that the flash memory is simply broken? Run dmesg -w and see if it reports any I/O errors the next time something seems to be stuck while reading from the drive. You can use dd </dev/sdx >/dev/null to test-read the whole drive.

Offline

#9 2016-05-27 18:43:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: dd command and broken usb flash drive

Your excerpts from posts 5 and 6 ddo not make sense.  If you zero'ed out the first 512 bytes, the disk might not be "fixed" but it definitely couldn't be recognized as NTFS.  Did you zero sdb or sdb1?  You seem to have left out the relevant part: the command you used.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#10 2016-05-28 21:53:00

andros705
Member
Registered: 2016-05-12
Posts: 24

Re: dd command and broken usb flash drive

Well dmesg -w gives me:

[  352.928588] blk_update_request: I/O error, dev sdb, sector 2080
[  352.928591] Buffer I/O error on dev sdb1, logical block 32, lost async page write
[  352.928595] Buffer I/O error on dev sdb1, logical block 33, lost async page write
[  352.928596] Buffer I/O error on dev sdb1, logical block 34, lost async page write
[  352.928598] Buffer I/O error on dev sdb1, logical block 35, lost async page write
[  359.497718] usb 2-4: reset high-speed USB device number 6 using xhci_hcd
[  366.207834] usb 2-4: reset high-speed USB device number 6 using xhci_hcd
[  372.918035] usb 2-4: reset high-speed USB device number 6 using xhci_hcd
[  379.628315] usb 2-4: reset high-speed USB device number 6 using xhci_hcd
[  386.338709] usb 2-4: reset high-speed USB device number 6 using xhci_hcd
[  393.052239] usb 2-4: reset high-speed USB device number 6 using xhci_hcd
[  393.226680] sd 2:0:0:0: [sdb] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
[  393.226685] sd 2:0:0:0: [sdb] tag#0 CDB: opcode=0x2a 2a 00 00 73 93 f8 00 00 04 00
[  393.226688] blk_update_request: I/O error, dev sdb, sector 7574520
[  393.226691] Buffer I/O error on dev sdb1, logical block 7572472, lost async page write
[  393.226694] Buffer I/O error on dev sdb1, logical block 7572473, lost async page write
[  393.226696] Buffer I/O error on dev sdb1, logical block 7572474, lost async page write
[  393.226697] Buffer I/O error on dev sdb1, logical block 7572475, lost async page write

Offline

Board footer

Powered by FluxBB