hi,
On Mar 20, 8:55am, Martin K. Petersen wrote:
> Subject: Re: Bugreport - not really important
> >>>>> "Tom" == Tom Duffy <tduffy@xxxxxxxxxxxx> writes:
>
> Tom> what I am surprised about is that xfs did not replace the magic
> Tom> number that tells the kernel and other tools what type of fs it
as Martin said, there's no one location to poke a new magic
number. mount(8) has knowledge of known good places to go
and look for the primary superblock & magic numbers therein,
and unless given the -t arg, will basically make an educated
guess at the filesystem type.
mkfs.xfs(8) shares this probing code and will also attempt to
identify an existing filesystem before overwriting it - there
is just no support for reiser in there yet (cos its not in the
mount code - see util-linux-2.11/mount/mount_guess_fstype.c).
[be good if someone would do the reiser side of things for
mount, & we would just pick it up from Andries' mount code]
> Tom> is. otherwise, the reiser tools do not verify this number (or
> Tom> assume it could be corrupted).
>
> The problem here is that every fs puts its superblock a different
> place. XFS has it on block 0, and reiserfs' is 64K from the beginning
> of the device.
>
> It so happens that in your case XFS doesn't write anything on that
> position. Consequently, the reiser superblock is intact after
> mkfs.xfs.
>
> There's really no smart way to avoid this as that would require
> knowledge of all file systems on the planet. Some may have their sb
> at the middle or the end of the device etc. And dd'ing zeroes to the
> entire device will take forever.
>
(nod)
> I guess we could blast - say 70KB - of NULL chars to the start of the
> partition. As far as I can tell, that should get rid of any fs that
> Linux currently supports (Unless they try and use backup copies in
> that case. I guess we'll have to experiment a bit).
>
> Nathan, comments?
>
yeah, thats probably the simplest solution (hack!)- delicate
like a sledgehammer, but I guess its the only sure-fire way.
be careful about going back from the end, I think there may
be an md superblock back there (?) and that was also how we
got into the need for BLKSETSIZE (we used to blow away last
512bytes in case an old EFS superblock was there).
cheers.
--
Nathan
|