Alternative way to earn the bounty: Show me how to store a file system like ext4 (a FS which can store large files, I don't really need all of the good stuff ext4 provides for this use case) in many small files (< 4 GiB) stored on a (working) FAT-formatted partition.
I have an SD card (adverties as 64 GB but other than usual storage media has less than that (it has 63'416'827'904 Byte)) and an SD slot on my laptop (an Acer Aspire VN7-591G-70CY). The SD card worked with my previous laptop without problems and is formatted with ext4.
I tried
sudo modprobe -r r852; sudo modprobe -r sdhci_pci; sudo modprobe r852; sudo modprobe sdhci_pci
which helped others but did nothing for me.
The SD card works with an SD card to USB adapter. When using this adapter the SD card is /dev/sdb
and the single partition on it is /dev/sdb1
. When I put it into the SD card slot it is /dev/mmcblk0
and its partition is /dev/mmcblk0p1
.
When I enter the SD card into the slot, nautilus says:
Error mounting /dev/mmcblk0p1 at /media/christoph/e07d3be4-bd85-4eb2-9205-d6638ab37704: Command-line `mount -t "ext4" -o "uhelper=udisks2,nodev,nosuid" "/dev/mmcblk0p1" "/media/christoph/e07d3be4-bd85-4eb2-9205-d6638ab37704"' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on /dev/mmcblk0p1, missing codepage or helper program, or other error
In some cases useful info is found in syslog - try dmesg | tail or so.
Mounting it manually results in pretty much the same error message:
mount: wrong fs type, bad option, bad superblock on /dev/mmcblk0p1, missing codepage or helper program, or other error
In some cases useful info is found in syslog - try dmesg | tail or so.
Now the weird part is that dd
doesn't seem to work in either case. I copied the first 100 MiB of each /dev/sdb
, /dev/sdb1
, /dev/mmcblk0
and /dev/mmcblk0p1
and earlier this day even got matching sha256-sums.
They now don't match any more but are very similar in the way that except for a little bit in the beginning almost exclusively consist of zero bytes even though the SD card is almost entirely full (and filled with compressed and encrypted data, so there shouldn't me many zero bytes).
So I replaced every instance of 4 consecutive zero bytes in $mmcblk0
(the copies I made via dd
are named exactly the same as the devices but I but a dollar sign before the name so they can be differentiated) with plain nothingness in a hex editor and ended up with files just being 129.4 kB for r$sdb
(the 'r' is for 'reduced' / 'replaced') and 312.7 kB for r$mmcblk0
instead of being 104.9 MB each.
r$sdb
has a mount point stated in the beginning (and I have no idea why). It really is the mount point the SD card was mounted on. Then comes randomly seeming data with a lot of repetitions, followed by a whole lot of FF bytes, followed by actual names of files saved on the SD card, followed by a little more randomly seeming data but not much.
About the fist 1600 Byte in r$mmcblk0
are exactly the same as in r$sdb
(this includes the mount point even though the SD card couldn't be mounted while in the slot). Then comes randomly seeming data with a lot of repetitions but with big blocks made from printable characters including file paths, followed by FF bytes, followed by exactly the same as the ending of r$sdb
(actual names of files saved on the SD card, followed by a little more randomly seeming data but not much).
Can you help me to resolve the problem and maybe tell me why dd
outputs this weird data?
I figured out how to make it work with FAT myself. I ran apt-get install nfs-common
, rebooted and now FAT is working. Unfortunately, FAT is a shitty file system which doesn't support loads of stuff and I need file many GB in size which aren't supported by FAT. So I cannot use the SD card with FAT at all.
If I format the partition with ext4, the same error as previously occurs. For FAT everything seems fine.
Is there a command to make it work for ext4 as well?
$ sudo fdisk -l
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 2D8D2D1D-B17D-4F86-ACD1-743E6B376EFE
Device Start End Sectors Size Type
/dev/sda1 2048 1230847 1228800 600M Windows recovery environment
/dev/sda2 1230848 1845247 614400 300M EFI System
/dev/sda3 1845248 2107391 262144 128M Microsoft reserved
/dev/sda4 1716043776 1920843775 204800000 97.7G Microsoft basic data
/dev/sda5 1920843776 1953523711 32679936 15.6G Windows recovery environment
/dev/sda6 2107392 36923391 34816000 16.6G Linux swap
/dev/sda7 36923392 1716043775 1679120384 800.7G Linux filesystem
Partition table entries are not in disk order.
Disk /dev/mmcblk0: 59.1 GiB, 63416827904 bytes, 123860992 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: 0xd69abc36
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 2048 123860991 123858944 59.1G 83 Linux
Disk /dev/mapper/cryptswap1: 16.6 GiB, 17825267712 bytes, 34814976 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
$ lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d5)
00:1c.3 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #4 (rev d5)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation HM86 Express LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05)
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)
01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 860M] (rev a2)
07:00.0 Network controller: Intel Corporation Wireless 7265 (rev 48)
08:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
I think that the last part of the output of dmesg is interesting:
[10106.153215] mmc0: new ultra high speed SDR50 SDXC card at address 59b4
[10106.153349] mmcblk0: mmc0:59b4 SD 59.0 GiB
[10106.158564] mmcblk0: unknown partition table
[10109.748018] mmcblk0: p1
[10110.393758] mmcblk0: error -110 sending stop command, original cmd response 0x900, card status 0x900
[10111.098030] mmcblk0: error -110 sending stop command, original cmd response 0x900, card status 0x900
[10111.862596] mmcblk0: error -110 sending stop command, original cmd response 0x900, card status 0x900
[10111.862610] EXT4-fs (mmcblk0p1): Magic mismatch, very weird!
[10201.953257] mmcblk0: error -110 sending stop command, original cmd response 0x900, card status 0x900
[10202.553754] mmcblk0: error -110 sending stop command, original cmd response 0x900, card status 0x900
[10202.555661] EXT4-fs (mmcblk0p1): ext4_check_descriptors: Checksum for group 48 failed (26727!=0)
[10202.555664] EXT4-fs (mmcblk0p1): group descriptors corrupted!
Unable to read the contents of this file system! Because of this some operations may be unavailable. The cause might be a missing software package. The following list of software packages is required for ntfs file system support: ntfsprogs / ntfs-3g.
Packagentfs-3g
is installed,ntfsprogs
has no installation candidate (is superseded byntfs-3g
?). – UTF-8 Jul 04 '15 at 20:33ntfsprogs
package was renamed tontfs-3g
in Ubuntu 13.04." – UTF-8 Jul 04 '15 at 20:40dd
from the SD card. After I did my experiments, I did thedd
back and the error message "dd: error writing ‘/dev/mmcblk0p1’: No space left on device" appeared immediately. Not after a plausible period of time fordd
to have written enough information but instantly when I executed the command. However,dd
kept running and copied the information back onto the SD card. Now there are the correct files on the SD card, but when Idd
again, I get back a different image (volume wasn't mounted). – UTF-8 Jul 11 '15 at 22:24