microsd not showing full capacity / dd failure with Raspbian

Here you can discuss every aspect of Debian. Note: not for support requests!
Post Reply
Message
Author
ovitus
Posts: 4
Joined: 2020-01-07 15:39

microsd not showing full capacity / dd failure with Raspbian

#1 Post by ovitus »

Why is my microSD card showing a smaller size with fdisk then lsblk?

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 2.2G 0 loop /mnt2
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 460.3G 0 part /
└─sda2 8:2 0 16.6G 0 part [SWAP]
mmcblk0 179:256 0 59.5G 0 disk
└─mmcblk0p1 179:257 0 59.5G 0 part


root@t460:~# fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 7.5 GiB, 8076152832 bytes, 15773736 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

I'm trying to copy Raspbian img over, but it's failing:
root@t460:/home/awright/Downloads# dd if=2019-09-26-raspbian-buster-lite.img of=/dev/mmcblk0p1
dd: writing to '/dev/mmcblk0p1': Input/output error
3418113+0 records in
3418112+0 records out
1750073344 bytes (1.8 GB, 1.6 GiB) copied, 582.939 s, 3.0 MB/s

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: microsd not showing full capacity / dd failure with Rasp

#2 Post by Head_on_a_Stick »

ovitus wrote:

Code: Select all

dd: writing to '/dev/mmcblk0p1': Input/output error
Looks like it might be broken, does it work with other devices?

Try https://packages.debian.org/buster/f3
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

arochester
Global Moderator
Global Moderator
Posts: 2018
Joined: 2010-12-07 19:55
Has thanked: 1 time
Been thanked: 2 times

Re: microsd not showing full capacity / dd failure with Rasp

#3 Post by arochester »

Raspberry Pi Forums >>> https://www.raspberrypi.org/forums/

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: microsd not showing full capacity / dd failure with Rasp

#4 Post by Head_on_a_Stick »

arochester wrote:Raspberry Pi Forums
That was my first thought as well but the OP appears to be trying to burn a Raspbian image to the SD card from Debian so the thread is appropriate here IMO.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

ovitus
Posts: 4
Joined: 2020-01-07 15:39

Re: microsd not showing full capacity / dd failure with Rasp

#5 Post by ovitus »

I posted on the Raspberry Pi forums also. I can't mount the drive to test with F3:

root@t460:/home/awright/Downloads# mount /dev/mmcblk0p1 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/mmcblk0p1, missing codepage or helper program, or other error.

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: microsd not showing full capacity / dd failure with Rasp

#6 Post by Head_on_a_Stick »

Yeah that looks dead to me.

We could check the filesystem:

Code: Select all

/sbin/wipefs /dev/mmcblk0p1
Then make sure the appropriate filesystem tools are installed (for example, e2fsprogs for ext{2,3,4}) so you can try again if they aren't but I wouldn't hold out much hope.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

p.H
Posts: 1891
Joined: 2017-09-17 07:12

Re: microsd not showing full capacity / dd failure with Rasp

#7 Post by p.H »

Head_on_a_Stick wrote:Yeah that looks dead to me.
Without even checking the kernel logs with dmesg ?
Head_on_a_Stick wrote:Then make sure the appropriate filesystem tools are installed (for example, e2fsprogs for ext{2,3,4})
No "filesystem tools" are required to mount most local filesystem types which have kernel drivers (such as ext* - not NFS which is a network filesystem type). Appropriate tools are required for filesystem types which have FUSE drivers, such as NTFS and exFAT.

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: microsd not showing full capacity / dd failure with Rasp

#8 Post by Head_on_a_Stick »

p.H wrote:
Head_on_a_Stick wrote:Yeah that looks dead to me.
Without even checking the kernel logs with dmesg ?
Yes indeed, good point :D

@OP: make it so.
p.H wrote:No "filesystem tools" are required to mount most local filesystem types which have kernel drivers (such as ext* - not NFS which is a network filesystem type). Appropriate tools are required for filesystem types which have FUSE drivers, such as NTFS and exFAT.
I did not know that, thanks for the correction. And e2fsprogs is an essential package anyway, how embarassing...
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

ovitus
Posts: 4
Joined: 2020-01-07 15:39

Re: microsd not showing full capacity / dd failure with Rasp

#9 Post by ovitus »

I've gotten it working, did some reformatting with an Android phone, deleted extra partitions... anyway copying the Raspian img formats the size to something ~2GB, after which it inflates it to its maximum size during install, hence my initial confusion.

p.H
Posts: 1891
Joined: 2017-09-17 07:12

Re: microsd not showing full capacity / dd failure with Rasp

#10 Post by p.H »

That does not explain why lsblk and fdisk show different sizes. They don't care about the image size.

Post Reply