Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] dd if=/dev/mmcblk0 fails after reading 10MB
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
maiku
Guru
Guru


Joined: 24 Mar 2004
Posts: 575
Location: Long Island, NY

PostPosted: Wed Mar 30, 2016 8:33 pm    Post subject: [solved] dd if=/dev/mmcblk0 fails after reading 10MB Reply with quote

Up until two days ago, I was mysteriously able to write to and read from /dev/mmcblk0 with dd. Now, all of the sudden it gives me a "not enough space on device" error when I try to write and only reads 10MB when I try to read.
Quote:
sudo dd if=/dev/mmcblk0 of=test.img
20480+0 records in
20480+0 records out
10485760 bytes (10 MB) copied, 0.0762475 s, 138 MB/s
Or if I try to write an image
Quote:
sudo dd if=test.img of=/dev/mmcblk0
dd: writing to ‘/dev/mmcblk0’: No space left on device
20481+0 records in
20480+0 records out
10485760 bytes (10 MB) copied, 0.0260486 s, 403 MB/s
However! If I try to read from /dev/mmcblk0p1 or /dev/mmcblk0p2 it'll work just fine.

These are Raspberry Pi images, so I need to write them directly to /dev/mmcblk0.

What could have caused this strange one?
_________________
Michael A. Leonetti
As warm as green tea


Last edited by maiku on Fri Apr 01, 2016 12:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43210
Location: 56N 3W

PostPosted: Wed Mar 30, 2016 9:11 pm    Post subject: Reply with quote

maiku,

I suspect that you have a bad block at around 10Mb. Unless you tell dd what to do about errors, it just stops.
dmesg will tell you. Run the dd until it fails, then look in dwesg.

If you do have a bad block, the only way that dd can continue is to drop the data at that location. Its an image file, it either works or it doesn't.
You can loop mount the image and use the filesystems it contains.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2970
Location: Germany

PostPosted: Wed Mar 30, 2016 9:35 pm    Post subject: Reply with quote

blockdev --getsize64 /dev/mccblk0?
Back to top
View user's profile Send private message
maiku
Guru
Guru


Joined: 24 Mar 2004
Posts: 575
Location: Long Island, NY

PostPosted: Fri Apr 01, 2016 12:44 pm    Post subject: Reply with quote

Forgot to comment on this. Thanks Neddy for commenting again on one of my drive madness posts.

I can't honestly say why it stopped working. I thought it was the card, too, at first. So I changed the cards. After the fourth card I thought, "It's probably not the card." Then on a whim I upgraded the kernel and it started working flawlessly again. So I just kind of left it at that.

Thank you for all of your help! <3
_________________
Michael A. Leonetti
As warm as green tea
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum