Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Mar 2020 15:30:13 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Claude Buisson <claude.buisson1@free.fr>
Cc:        freebsd-questions@freebsd.org, freebsd@dreamchaser.org
Subject:   Re: SD card formatting
Message-ID:  <20200317153013.7257bbe1.freebsd@edvax.de>
In-Reply-To: <8a95e209-52f1-6873-9500-9e1bdd826e18@free.fr>
References:  <b7070f0e-a387-9c7e-945f-ab708f9f5a76@dreamchaser.org> <8a95e209-52f1-6873-9500-9e1bdd826e18@free.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 17 Mar 2020 00:37:21 +0100, Claude Buisson wrote:
> On 2020-03-15 22:39, Gary Aitken wrote:
> > 11.3-RELEASE-p6 GENERIC=A0 amd64
> >=20
> > I'm having trouble reading SD cards formatted in my camera (Olympus=20
> > EM1-MkII)
> > or on a Win 7 system.=A0 When attempting to mount, I get the following:
> >=20
> > $ mount -t msdosfs /dev/da0s1 /mnt/memstick
> > mount_msdosfs: /dev/da0s1: Invalid argument
> > $ mount -t ntfs /dev/da0s1 /mnt/memstick
> > mount: /dev/da0s1: Operation not supported by device
> >=20
> > Cards used without formatting *usually* seem to work.
> >=20
> > If I look at the cards which don't mount using gpart, I see:
> >=20
> > Card formatted in camera:
> > $ gpart show -p /dev/da0
> > =3D>=A0=A0=A0=A0=A0=A0 63=A0 120944577=A0=A0=A0 da0=A0 MBR=A0 (58G)
> >  =A0=A0=A0=A0=A0=A0=A0=A0 63=A0=A0=A0=A0=A0 32705=A0=A0=A0=A0=A0=A0=A0=
=A0 - free -=A0 (16M)
> >  =A0=A0=A0=A0=A0 32768=A0 120911872=A0 da0s1=A0 ntfs=A0 [active]=A0 (58=
G)
> > $ gpart show -r /dev/da0
> > =3D>=A0=A0=A0=A0=A0=A0 63=A0 120944577=A0 da0=A0 MBR=A0 (58G)
> >  =A0=A0=A0=A0=A0=A0=A0=A0 63=A0=A0=A0=A0=A0 32705=A0=A0=A0=A0=A0=A0 - f=
ree -=A0 (16M)
> >  =A0=A0=A0=A0=A0 32768=A0 120911872=A0=A0=A0 1=A0 7=A0 [active]=A0 (58G)
> >=20
> > If I look at cards that I know I can mount I see the following:
> >=20
> > $ gpart show -p da0
> > =3D>=A0=A0=A0=A0=A0 63=A0 30375873=A0=A0=A0 da0=A0 MBR=A0 (14G)
> >  =A0=A0=A0=A0=A0=A0=A0 63=A0=A0=A0=A0=A0 8129=A0=A0=A0=A0=A0=A0=A0=A0 -=
 free -=A0 (4.0M)
> >  =A0=A0=A0=A0=A0 8192=A0 15118336=A0 da0s1=A0 fat32lba=A0 (7.2G)
> >  =A0 15126528=A0 15249408=A0=A0=A0=A0=A0=A0=A0=A0 - free -=A0 (7.3G)
> > $ gpart show -r /dev/da0
> > =3D>=A0=A0=A0=A0=A0 63=A0 30375873=A0 da0=A0 MBR=A0 (14G)
> >  =A0=A0=A0=A0=A0=A0=A0 63=A0=A0=A0=A0=A0 8129=A0=A0=A0=A0=A0=A0 - free =
-=A0 (4.0M)
> >  =A0=A0=A0=A0=A0 8192=A0 15118336=A0=A0=A0 1=A0 12=A0 (7.2G)
> >  =A0 15126528=A0 15249408=A0=A0=A0=A0=A0=A0 - free -=A0 (7.3G)
> >=20
> > or:
> >=20
> > $ gpart show -p /dev/da0
> > =3D>=A0=A0=A0=A0=A0=A0 1=A0 15633407=A0=A0=A0 da0=A0 MBR=A0 (7.5G)
> >  =A0=A0=A0=A0=A0=A0=A0=A0 1=A0=A0=A0=A0=A0=A0=A0 31=A0=A0=A0=A0=A0=A0=
=A0=A0 - free -=A0 (16K)
> >  =A0=A0=A0=A0=A0=A0=A0 32=A0 15633376=A0 da0s1=A0 fat32=A0 (7.5G)
> > $ gpart show -r /dev/da0
> > =3D>=A0=A0=A0=A0=A0=A0 1=A0 15633407=A0 da0=A0 MBR=A0 (7.5G)
> >  =A0=A0=A0=A0=A0=A0=A0=A0 1=A0=A0=A0=A0=A0=A0=A0 31=A0=A0=A0=A0=A0=A0 -=
 free -=A0 (16K)
> >  =A0=A0=A0=A0=A0=A0=A0 32=A0 15633376=A0=A0=A0 1=A0 11=A0 (7.5G)
> >=20
> > I tried reformatting as follows:
> >=20
> > # gpart delete -i 1 da0
> > da0s1 deleted
> > # gpart add -i 1 -a 4M -t "\!11" da0
> > da0s1 added
> > # gpart show -r da0
> > =3D>=A0=A0=A0=A0=A0=A0 63=A0 120944577=A0 da0=A0 MBR=A0 (58G)
> >  =A0=A0=A0=A0=A0=A0=A0=A0 63=A0=A0=A0=A0=A0=A0 8129=A0=A0=A0=A0=A0=A0 -=
 free -=A0 (4.0M)
> >  =A0=A0=A0=A0=A0=A0 8192=A0 120930304=A0=A0=A0 1=A0 11=A0 (58G)
> >  =A0 120938496=A0=A0=A0=A0=A0=A0 6144=A0=A0=A0=A0=A0=A0 - free -=A0 (3.=
0M)
> > # newfs_msdos -F 32 /dev/da0s1
> > /dev/da0s1: 120900736 sectors in 1889074 FAT32 clusters (32768=20
> > bytes/cluster)
> > BytesPerSec=3D512 SecPerClust=3D64 ResSectors=3D32 FATs=3D2 Media=3D0xf=
0=20
> > SecPerTrack=3D63 Heads=3D255 HiddenSecs=3D0 HugeSectors=3D120930304=20
> > FATsecs=3D14759 RootCluster=3D2 FSInfo=3D1 Backup=3D2
> >=20
> > If I put this card in the camera, I get an error ("Card Error")
> > If I again format the card in the camera, I can't mount it.
> >=20
> > I need to reformat these cards so I can use them in the camera and on
> > freebsd, and apparently neither the camera nor win7 does that, so...
> > What's the right way to lay out, format, and create a file system on an
> > SD card so it is usable by cameras and windoze?
> >=20
> > Thanks,
> >=20
> > Gary
> > _______________________________________________
> > freebsd-questions@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to=20
> > "freebsd-questions-unsubscribe@freebsd.org"
>=20
> Your card with a capacity > 32GB must be formatted as exFAT
>=20
> The partition type seen by gpart is the same as NTFS
>=20
> man gpart
>   ...
>   ntfs      A partition that contains a NTFS or exFAT filesystem
>=20
> see also Bug 244461

Excellent finding!

I think this is the key to a solution. The remaining questions are:

1. How to mount exFAT on FreeBSD?

I think I can answer that: A FUSE module is required. Install
fusefs-exfat (and maybe exfat-utils) from the sysutils category
to get mount.exfat and exfatfsck (if it should be needed).
Inegration with /etc/fstab should be no problem.

2. How to initialize a exFAT SD card on FreeBSD?

Probably with mkexfatfs from exfat-utils (as mentioned above).




--=20
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200317153013.7257bbe1.freebsd>