From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Mon, 06 Mar 2006 22:37:20 +0000 Subject: Re: Libvolume incorrectly detects FAT32 Message-Id: <20060306223720.GC32389@vrfy.org> List-Id: References: <20060306215704.35f12840@silver> In-Reply-To: <20060306215704.35f12840@silver> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Mon, Mar 06, 2006 at 10:59:31PM +0100, Michael Buesch wrote: > On Monday 06 March 2006 21:57, iSteve wrote: > > Hello, > > I'm having one silly partition, which has remnants of previous FAT32 filesystem > > on it, a LILO bootloader on it and ext2 filesystem spaning all over the > > partition. > > > > The first 512B look exactly like a valid FAT partition header would, except the > > magic is "LILO". > > > > I've looked at the sources for FAT detection, and I noted that when a FAT-like > > filesystem misses magic, it's still considered valid, since as comment says, > > some old floppies may lack it. I consider this point valid, however, this > > causes my partition to be detected, incorrectly, as FAT32. > > > > My proposed solution is to compare magic if FAT32 is assumed, and if magic will > > not match for FAT32, consider it a failure; floppies that old that they lack > > any magic will most likely not be formatted in FAT32. > > > > Trivial patch is attached, comments/complaints?:) > > Yes, I fear users of stupid digicams may get hit by this. > The Formating option on cheap digicams may sometimes be buggy implemented. > I think you should instead do a > dd if=/dev/zero of=/dev/partition bsQ2 count=1 > and reformat your partition. Yes, just use a sane formatting program like everything which is libparted based. The usual Linux commandline formatters are horribly broken and I gave up to talk to the ignorant maintainers. Just zero-out the device at the beginning _and_ the end of the device if you reformat it with a new filesystem type. Or use a libparted or similar based program. Thanks, Kay ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel