Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 May 2014 17:41:02 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Arthur Chance <freebsd@qeng-ho.org>
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: write-protected usb flash drive
Message-ID:  <20140524174102.66eff3da.freebsd@edvax.de>
In-Reply-To: <5380B953.5090700@qeng-ho.org>
References:  <537FE744.3030002@dreamchaser.org> <20140524080127.f2e788d5.freebsd@edvax.de> <5380AB17.2070300@dreamchaser.org> <5380B953.5090700@qeng-ho.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 24 May 2014 16:22:59 +0100, Arthur Chance wrote:
> OK, thought I'd better try my own advice rather than just handing it 
> out. I put a microSD card out of an old phone into a SanDisk mSD -> SD 
> adapter and plugged that into my SanDisk SD -> USB adapter, mounted it 
> (FAT32 file system already on it) and wrote a file to it. Worked as 
> you'd expect. I then unmounted and unplugged it, flipped the write 
> protect switch and tried to remount. Result was
> 
> mount_msdosfs: /dev/da5s1: Input/output error
> 
> Mounting it read-only was fine. So, the write protect is honoured by at 
> least some SD -> USB adapters.

This is already on file system level. It _should_ work the same
at upper layers, for example when using dd to write NULs to the
device with the write protection on - an error should (correctly)
occur in that case.

When a r/o mount is forced, the routines accessing that file
system cannot avoid the write protection. Still writes are
possible _aside of_ the file system which should be prevented
by the switch as well. It's probably a good idea to check that
too, e. g. put in the card with write protection on and then
try dd or newfs on it.



-- 
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?20140524174102.66eff3da.freebsd>