Formatting an SD card with mkfs hangs indefinitely
7
votes
1
answer
17754
views
I am trying to format an SD card following [this](https://archlinuxarm.org/platforms/armv7/broadcom/raspberry-pi-2#installation) guide. I am able to successfully create the partition table, but attempting to format the Linux partition with
mkfs
yields the following output:
mke2fs 1.42.9 (4-Feb-2014)
Discarding device blocks: 4096/1900544
where it appears to hang indefinitely. I have left the process running for a while but nothing changes. If I eject the SD card then mkfs writes the expected output to the terminal:
mke2fs 1.42.9 (4-Feb-2014)
Discarding device blocks: failed - Input/output error
Warning: could not erase sector 2: Attempt to write block to filesystem resulted in short write
warning: 512 blocks unused.
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
476064 inodes, 1900544 blocks
95026 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1946157056
58 block groups
32768 blocks per group, 32768 fragments per group
8208 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tables: done
Warning: could not read block 0: Attempt to read block from filesystem resulted in short read
Warning: could not erase sector 0: Attempt to write block to filesystem resulted in short write
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: 0/58
Warning, had trouble writing out superblocks.
Why is mkfs reporting that we are "discarding" blocks and what might be causing the hangup?
---------------
**EDIT**
I am able to successfully create two partitions -- one at 100MB and the other 7.3GB. I then can format, and mount, the 100MB partition as FAT32 -- it's the ext4 7.3GB partition that is having this trouble.
dmesg is flooded with:
[ 9350.097112] mmc0: Got data interrupt 0x02000000 even though no data operation was in progress.
[ 9360.122946] mmc0: Timeout waiting for hardware interrupt.
[ 9360.125083] mmc_erase: erase error -110, status 0x0
[ 9360.125086] end_request: I/O error, dev mmcblk0, sector 3096576
**EDIT 2**
It appears the problem manifests when I am attempting to format as ext4. If I format the 7.3GB partition as FAT32, as an example, the operation succeeds.
**EDIT 2**
To interestingly conclude the above, I inserted the SD card into a BeagleBone and formatted it in the exact same way I was on Mint and everything worked flawlessly. I removed the SD card, reinserted it into my main machine and finished copying over the data to the newly created and formatted partitions.
Asked by sherrellbc
(2601 rep)
Jan 11, 2016, 05:47 PM
Last activity: Jan 19, 2025, 01:21 AM
Last activity: Jan 19, 2025, 01:21 AM