Re: Upgrading datastructures between different filesystem versions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 28, 2007 at 02:31:46PM +0100, Christoph Hellwig wrote:
> On Fri, Sep 28, 2007 at 03:11:00PM +0200, Erik Mouw wrote:
> > There are however ways to confuse it: if you reformat an ext3
> > filesystem to reiserfs (version 3), mounting that filesystem without
> > "-t reiserfs" will trick mount(8) into mounting it as an ext3
> > filesystem (which will usually fail). This is because the ext3
> > superblocks lives at offset 0x400, and the reiserfs superblock at
> > 0x8000. When you format a partition as reiserfs, it will not erase old
> > ext3 superblocks. Before looking for a reiserfs superblock, mount(8)
> > first looks for an ext3 superblock. The old ext3 superblock wasn't
> > erased, but usually most of the other ext3 structures are and so
> > mount(8) will fail to mount the filesystem. Don't know if this
> > particular "bug" is still there, but it has bitten me in the past.
> 
> This is easy to fix, though.  Quoting mkfs.xfs:
> 
> 	/*
>          * Zero out the beginning of the device, to obliterate any old
> 	 * filesystem signatures out there.  This should take care of
> 	 * swap (somewhere around the page size), jfs (32k),
> 	 * ext[2,3] and reiserfs (64k) - and hopefully all else.
> 	 */
> 	buf = libxfs_getbuf(xi.ddev, 0, BTOBB(WHACK_SIZE));
> 	bzero(XFS_BUF_PTR(buf), WHACK_SIZE);
> 	libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
> 	libxfs_purgebuf(buf);

Ext3 does something similar, zapping space at the beginning AND the
end of the partition (because the MD superblocks are at the end).
It's just a misfeature of reiserfs's mkfs that it doesn't do this.

							- Ted
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux