From owner-freebsd-questions@freebsd.org Tue Mar 17 14:30:27 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E997268646 for ; Tue, 17 Mar 2020 14:30:27 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48hbDc3hsGz4JmG for ; Tue, 17 Mar 2020 14:30:24 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([178.12.42.103]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPA (Nemesis) id 1M2OEq-1jI2zA0Zxu-003yiA; Tue, 17 Mar 2020 15:30:14 +0100 Date: Tue, 17 Mar 2020 15:30:13 +0100 From: Polytropon To: Claude Buisson 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: <8a95e209-52f1-6873-9500-9e1bdd826e18@free.fr> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:/pOPdyIob4bNmgZz1ZmhdtsZiHai7i/w2lJQSQvTVvUqStegVZg qScb4c7r74tsRwuf16UP5fdP3DRT82NXjjAYn+DP5HlmOS5wPGSzzDA/r0p5UMrLSyXtscp pl9GVNPAfokd7bT/dwuF5AIqWr9Zs8sKkQ7L/taSuNVeSW/eshxDRlKADlFTheUxeKgYoj2 X6TeSFftml8KgsQVwiikw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:5d2myda+TJE=:oqvGcSLW7f5yJHORd7ikY9 wFdRjI5yqLL0UtV+Y3NW+KZN+Sqk5peVFDiH9lOWgGs0s79eSTEHhqRe+JxGs1crziAkX8rbA e7eGinF05az6+tDudfgViJ9xiiwV3NIfReq0jyypZ617dnJMcZQEWvkZqRfCm/5aQSpEYhEB8 s8dlj7VFq18mFCAxLs343R6yHLqUqycnSfSOHxHOI3mtJ789bO66C6mfUESJlGO85c5QT7Lec 9R2PWjxj3nGjBDxJbUM8YRMb8GTF6JjWUnkB875coAfDZMp13orXXHwpOmZDs6apJCIo5ozYK IRPChYX5QrhJrbr5wOJVN4Gdzgo5CezEkjTANeIEIZfQzheXO6dYOwryZEaXNGyDB7VgVKjXS NXd+ETwE5aGzNMx9EvndwXbMrBD7xenfbDD/nMCSM+2HV7xEJoTUlKjR2AqQAy7UmEg9p4jLL cijGmgZw30KAIY4yIGw/tElvXHvbZe/kfwm4XABCWwi1fztPdIB3Iqk5XMXPNyo4Jnie8bDKV P9g+XDxhBt9oevdkOB1DYLE01iJgasmE/E1WG5k2saORqyGzXApAVp3ZwokYNLU/n9G4uh4+S IWVaCbp+gme9Ak5RDm6OOWydjnUvjmpVsASrNPccLRRWMt/b1zz1i6sZeLWiH0D+hWaemzS0c CbyRz4fnvq4Ady5IxX4c1AFtGHQ4Oe8PanHCNHoAK+5c3WpMaRPyURmJP1HxwkXiLdqIRBVY0 IMaRMUBbALqC9Nuzzmj3RvXsSjj8Iu8+LJWB/KhEf6AQmUlAhAmvo65LsVlAbIRjCsx8FxnFv rApw2m9O5rOgdFavPWb5SGSxUdcsq4yq0UfFGSy3zOGB6ysYkOEJ/YzoI4rVmux3d50Orp7 X-Rspamd-Queue-Id: 48hbDc3hsGz4JmG X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.17.13) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [4.51 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; FREEMAIL_TO(0.00)[free.fr]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_PBL(0.00)[103.42.12.178.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.99)[0.994,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[0.999,0]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[13.17.227.212.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(0.12)[ip: (-0.45), ipnet: 212.227.0.0/16(-1.12), asn: 8560(2.18), country: DE(-0.02)] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2020 14:30:27 -0000 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, ...