1

I have latest Raspbian Lite burned on a SD card. When I dd the image into the card I can mount the boot and the rootfs partitions on my Ubuntu to access the files.

However as soon as I use this card in Raspberry, the rootfs partition is not usable anymore on my Ubuntu. I get:

Error mounting /dev/sdc2 at /media/user/rootfs1: Command-line
`mount -t "ext4" -o "uhelper=udisks2,nodev,nosuid" "/dev/sdc2"
"/media/user/rootfs1"' exited with non-zero exit status 32:
mount: wrong fs type, bad option, bad superblock on /dev/sdc2,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

The dmesg | tail returns:

[84253.709246] JBD2: Error -5 detected when updating journal superblock for sdc2-8.
[84253.709268] EXT4-fs error (device sdc2): ext4_put_super:815: Couldn't clean up the journal
[84253.709271] EXT4-fs (sdc2): Remounting filesystem read-only
[84253.709273] EXT4-fs (sdc2): previous I/O error to superblock detected     
[84253.744695] VFS: Dirty inode writeback failed for block device sdc1 (err=-5).
[84559.327185] sd 14:0:0:0: [sdc] 30318591 512-byte logical blocks: (15.5 GB/14.5 GiB)
[84559.332709]  sdc: sdc1 sdc2 [84559.333060] sdc: p2 size 30220288 extends beyond EOD, truncated
[84559.755070] EXT4-fs (sdc2): bad geometry: block count 3777536 exceeds size of device (3777535 blocks)
[84571.039961] EXT4-fs (sdc2): bad geometry: block count 3777536 exceeds size of device (3777535 blocks)

How to overcome this to access the files from the rootfs partition? Mind that it works perfectly fine on Raspberry nonetheless, it just won't mount on my computer.

3
  • What "rootfs partition"? What has this to do with Raspberry Pi?
    – Milliways
    May 24, 2018 at 12:24
  • Is rootfs in fact an ext4 partition? If I remember correctly, it might be exFAT. Try mounting it without specifying the file system.
    – Bex
    May 24, 2018 at 12:54
  • "I can mount the boot and the rootfs partitions on my Ubuntu to access the files." or " it just won't mount on my computer." ?? Which is it? May 24, 2018 at 13:40

2 Answers 2

3

EXT4FS errors. On your root partition.

Stop unplugging your PI without shutting down your OS first.

FS errors can often be repaired if you do

sudo touch /forcefsck

before you use the reboot command.

Then you WAIT for it to finish.

This command tells the PI to do a forced fsck (file system check) on the root partition before next boot. And it will attempt repairs if FS seems healthy enough for autorepairs to be relatively safe.

1

Ubuntu refuses to mount the rootfs partition because it finds the partition is larger than the device by 1 block. Simply repairing the filesystem (with fsck or otherwise) is unlikely to fix that.

You should try to shrink the rootfs partition (try gparted for instance). Shrinking by 1 MB should be enough. Or, if you still can boot your Raspberry with it, you can do so, then copy the files you need on Ubuntu on a thumb drive.

If you didn't do anything extravagant with your SD card, like manual editing of partitions or writing over the partition table with dd, then it may be that your SD card is defective or counterfeit. I would get an new one if I were you: the time you will spend hunting down errors on a faulty SD card will be worth far more than the 5-8 bucks you'll spend on a new one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.