1

so I have a single partition ext4 drive that I formatted in my Ubuntu desktop.

I connected it to another PC running debian and I cannot mount it.

Any ideas on how to fix it?

some info:

=> sudo mount -t ext4 /dev/sda1 /media/myuser/storage/
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
       missing codepage or helper program, or other error

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


root@mydesktop2:/home/myuser/scripts/system# tail /var/log/messages
Feb 24 13:30:31 mydesktop2 kernel: [ 5577.110672] EXT4-fs (sda1): bad geometry: block count 244190390 exceeds size of device (244190389 blocks)

root@mydesktop2:/home/myuser/scripts/system# fdisk /dev/sda

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p
Disk /dev/sda: 931.5 GiB, 1000204885504 bytes, 1953525167 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
Disklabel type: dos
Disk identifier: 0x276b2fc9

Device     Boot Start        End    Sectors   Size Id Type
/dev/sda1        2048 1953525167 1953523120 931.5G 83 Linux

Command (m for help):
  • seems to be geometry issue ... maybe ubuntu is more permissive so accept building it bad ... if you are sure you used ext4 – francois P Feb 24 '18 at 13:49
  • Definitely using ext4. I used mkfs.ext4 to format it – mrjayviper Feb 24 '18 at 14:21
  • Are you sure it is really /dev/sda in both machines? – Rui F Ribeiro Feb 24 '18 at 15:00
  • Interesting. What does file -s /dev/sda1 say on the machine that refuses mounting? Does fsck recognize the partition as valid ext4? – dhag Feb 24 '18 at 16:09
  • Adding to @dhag's comments, does fsck.ext4 -nvf /dev/sda1 show anything of interest? – ErikF Feb 24 '18 at 19:16
1

The problem appears to be caused by the difference in how the kernels determine the size of the partition. If you attach the drive to the Ubuntu system again, you could use resize2fs to shrink the filesystem by one block so that it can be mounted on the Debian kernel:

resize2fs /dev/sda1 244190389
  • This answer not exactly provides an answer to the question and it should be posted in Comments block bellow the question. – Yurij Goncharuk Apr 6 '18 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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