From owner-freebsd-questions@FreeBSD.ORG Sat May 24 15:44:44 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 403F2B4D for ; Sat, 24 May 2014 15:44:44 +0000 (UTC) Received: from blue.qeng-ho.org (blue.qeng-ho.org [217.155.128.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C088125AC for ; Sat, 24 May 2014 15:44:43 +0000 (UTC) Received: from fileserver.home.qeng-ho.org (localhost [127.0.0.1]) by fileserver.home.qeng-ho.org (8.14.7/8.14.5) with ESMTP id s4OFMx6g074012; Sat, 24 May 2014 16:23:02 +0100 (BST) (envelope-from freebsd@qeng-ho.org) Message-ID: <5380B953.5090700@qeng-ho.org> Date: Sat, 24 May 2014 16:22:59 +0100 From: Arthur Chance User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: freebsd@dreamchaser.org, Polytropon Subject: Re: write-protected usb flash drive References: <537FE744.3030002@dreamchaser.org> <20140524080127.f2e788d5.freebsd@edvax.de> <5380AB17.2070300@dreamchaser.org> In-Reply-To: <5380AB17.2070300@dreamchaser.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: FreeBSD Mailing List X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 15:44:44 -0000 On 24/05/2014 15:22, Gary Aitken wrote: > On 05/24/14 00:01, Polytropon wrote: >> On Fri, 23 May 2014 18:26:44 -0600, Gary Aitken wrote: >>> I'm having trouble locating what I want -- >>> a physically write-protected flash drive. >>> My searches so far have come up empty. >>> Thought someone here would know of one if it exists. >>> I don't want or need additional encryption gimicks on it. >>> Anyone know of one? 32G or larger >> >> I have been using something similar, even though it's not _exactly_ >> what you're asking for. My "solution" (haha): Get a SD card with >> the required capacity and initialize it as intended. Then use the >> write protection slider. The card is now write protected. Then get >> a USB card drive (usually in the shape of a regular USB stick, for >> example a USK SD/MMC/MS-MMC USB 2.0 card drive) and put the card in. >> Now you have a write-protected USB drive. :-) >> >> There are two advantages: >> >> a) In case of media failure, just replace the SD card. >> >> b) In case of reader failure, just replace the drive. >> >> Additional fun: If you use a SD->µSD adapter, you can also use a >> micro-SD card. The adapter then provides the write protection slider. >> The mentioned advantages still apply. :-) > > I like this option better than the Kanguru one, > mostly because the kanguru drives seem to not be very robust; > lots of failures reported. > > I don't see why it wouldn't work, but have you tried formatting / > initializing SD cards from the USB adapter instead of a device like a > camera? Wearing my paranoid sysadmin hat: given that the write protect switch on SD cards is purely advisory, it would be a good idea to check that the SD to USB adapter actually honours the advice. I.e. try to write to it with write protect on. [Slight pause.] 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. Looks like Polytropn's idea is the way to go if you want write protectable USB flash drives. The one I've got is a SanDisk MicroMate Reader, it's USB 2.0 and can handle cards up to 32GB, so it's just on the edge of what you need. I'd guess there's probably a USB 3.0 version around by now. As for formatting SD cards via a USB adapter, I've done that quite often. So far I've written disk images using dd (for RPi), used newfs_msdos for both FAT16 and FAT32 and plain newfs for UFS2 filesystems, all without problem.