Solved How determine the filesystem of an unmounted device?

I try to mount an SD card:
Code:
mount -t msdosfs /dev/mmcsd0 /mnt/exfat
and it gives
Code:
mount_msdosfs: /dev/mmcsd0: Invalid argument
Dmesg gives
Code:
mmc0: <MMC/SD bus> on sdhci_pci0
mmcsd0: 128GB <SDHC SK128 8.6 SN 2CF116F7 MFG 07/2025 by 3 SD> at mmc0 50.0MHz/4bit/65535-block
mmc0: detached
mmc0: <MMC/SD bus> on sdhci_pci0
mmcsd0: 128GB <SDHC SK128 8.6 SN 2CF116F7 MFG 07/2025 by 3 SD> at mmc0 50.0MHz/4bit/65535-block
Also
Code:
mount -t ntfs-3g /dev/mmcsd0 /mnt/exfat
gives the same error

file -s /dev/mmcsd0 gives
Code:
/dev/mmcsd0: DOS/MBR boot sector; partition 1 : ID=0x7, start-CHS (0x2,10,9), end-CHS (0x3ff,254,63), startsector 32768, 249966592 sectors, extended partition table (last)

I have fusefs.ko loaded too.
 
It looks like the SD card has a partition table, so you need to mount a partition instead of the device itself.
What is the output of gpart show mmcsd0 and gpart list mmcsd0?
 
It looks like the SD card has a partition table, so you need to mount a partition instead of the device itself.
What is the output of gpart show mmcsd0 and gpart list mmcsd0?
Code:
root@FreeBSD:/home/kostas # gpart show mmcsd0
=>       63  249999297  mmcsd0  MBR  (119G)
         63      32705          - free -  (16M)
      32768  249966592       1  ntfs  (119G)

root@FreeBSD:/home/kostas # gpart list mmcsd0
Geom name: mmcsd0
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 249999359
first: 63
entries: 4
scheme: MBR
Providers:
1. Name: mmcsd0s1
   Mediasize: 127982895104 (119G)
   Sectorsize: 512
   Stripesize: 4194304
   Stripeoffset: 0
   Mode: r0w0e0
   efimedia: HD(1,MBR,00000000,0x8000,0xee63000)
   rawtype: 7
   length: 127982895104
   offset: 16777216
   type: ntfs
   index: 1
   end: 249999359
   start: 32768
Consumers:
1. Name: mmcsd0
   Mediasize: 127999672320 (119G)
   Sectorsize: 512
   Stripesize: 4194304
   Stripeoffset: 0
   Mode: r0w0e0
there is also a /dev/mmcsd0s1 device
 
Code:
root@FreeBSD:/home/kostas # gpart show mmcsd0
=>       63  249999297  mmcsd0  MBR  (119G)
         63      32705          - free -  (16M)
      32768  249966592       1  ntfs  (119G)

root@FreeBSD:/home/kostas # gpart list mmcsd0
Geom name: mmcsd0
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 249999359
first: 63
entries: 4
scheme: MBR
Providers:
1. Name: mmcsd0s1
   Mediasize: 127982895104 (119G)
   Sectorsize: 512
   Stripesize: 4194304
   Stripeoffset: 0
   Mode: r0w0e0
   efimedia: HD(1,MBR,00000000,0x8000,0xee63000)
   rawtype: 7
   length: 127982895104
   offset: 16777216
   type: ntfs
   index: 1
   end: 249999359
   start: 32768
Consumers:
1. Name: mmcsd0
   Mediasize: 127999672320 (119G)
   Sectorsize: 512
   Stripesize: 4194304
   Stripeoffset: 0
   Mode: r0w0e0
there is also a /dev/mmcsd0s1 device

Alright, try to mount /dev/mmcsd0s1, probably with
Code:
mount -t ntfs-3g /dev/mmcsd0s1 /mnt/exfat
 
Alright, try to mount /dev/mmcsd0s1, probably with
Code:
mount -t ntfs-3g /dev/mmcsd0s1 /mnt/exfat
Code:
root@FreeBSD:/home/kostas # mount -t ntfs-3g /dev/mmcsd0s1 /mnt/exfat/
mount: /dev/mmcsd0s1: Invalid fstype: Invalid argument
root@FreeBSD:/home/kostas # mount -t msdosfs /dev/mmcsd0s1 /mnt/exfat/
mount_msdosfs: /dev/mmcsd0s1: Invalid argument
Sadly it also doesnt work
 
Code:
root@FreeBSD:/home/kostas # mount -t ntfs-3g /dev/mmcsd0s1 /mnt/exfat/
mount: /dev/mmcsd0s1: Invalid fstype: Invalid argument
root@FreeBSD:/home/kostas # mount -t msdosfs /dev/mmcsd0s1 /mnt/exfat/
mount_msdosfs: /dev/mmcsd0s1: Invalid argument
Sadly it also doesnt work

Ah, I never mounted a NTFS filesystem myself on FreeBSD. Using mount(8) probably isn't working here. I assume you have to use the specific ntfs-3g(8) to mount a NTFS filesystem (untested on my side):
Code:
ntfs-3g /dev/mmcsd0s1 /mnt/exfat
 
fstype /dev/mmcsd0s1

Just because the slice is labeled as 'ntfs' doesn't mean the filesystem is NTFS.
It is a SanDisk 128 GB microSD card inserted in an SD adapter into an x230 thinkpad SD card slot. I have deactivated some buses and ports from the BIOS for power efficiency, but i think this doesnt affect the SD card as it is active and seen.
 
If the partition is formatted with exfat, you would need filesystems/exfat installed (possibly filesystems/exfat-utils, too, to determine filesystem).


If I recall correctly, at least early versions of NTFS (on MBR scheme) used the same one that HPFS used. It was quite annoying for OS/2 users.
Installed both, still mount -t exfat /dev/mmcsd0s1 /mnt/exfat fails with
Code:
mount: /dev/mmcsd0s1: Invalid fstype: Invalid argument
mount -t exfat /dev/mmcsd0 the same
 
Solved as seen in this thread:
(reply #5 by smithi)

mount -t exfat doesnt seem to work as intended, need to use mount.exfat instead

Thanks all for the help.
 
Back
Top