Mulinux trashed my root device

From: Sebastian Leske (sleske@enterprise.mathematik.uni-essen.de)
Date: Fri Aug 10 2001 - 00:33:24 CEST


Hi,

I just downloaded the latest version of muLinux (12r0), put it on a
floppy
and was very satisfied with it.

I installed on one computer and had it save the configuration.

Then I put the disk into my second machine, without remembering that
the disk was configured for my first machine.

The disk booted fine, but then proceeded so set up the swap partition
on the same partition I had set it up on Computer #1.
Unfortunately, this is my root partition on Computer #2, which now
seems gone.

Therefore 2 questions:

1) Is there any way to get back the trashed partition?
[Update: I managed to get my data back by telling e2fsck to use an
alternative superblock. Thank god ext2fs keeps multiple copies...].

2) Why doesn't mulinux check whether the partition is actually
formatted as a swap partition before putting it into service??

Actually, looking into the source, there seems to be a check:
[excerpt from /setup/fun/swap.fun in the MuLinux ROOT partition]:
# there is Linux swap signature?

magic=`dd if=${source} bs=1c skip=4086 count=10 2>/dev/null`

if [ "$magic" != SWAP-SPACE ] || [ "$ACTION" = ask_the_user ]
then

        if [ "$SIZE" ] ; then
        tell "Creating swapfile ..."
        dd if=/dev/zero of=/dev/swap bs=1k count=$SIZE
        fi

        mkswap /dev/swap $SIZE
        sync
fi

But as you can see, if it finds that the partition to set up swap on is
not yet formatted as a swap partition, it does not warn you, but
instead just formats (mkswap) it. Bad....

This is IMHO a critical bug. You just configure a disk on one computer
to use a swap partition, then if you ever put it into a different
computer (or repartition), the disk will immediately & mercylessly
trash whatever partition happens to have the number of the swap
partition in the original setup.

My proposal: MuLinux should never use mkswap except during initial
configuration. On subsequent boots (i.e. on all boots with a
'preconfigured' floppy) it should only do 'swapon'. That will
gracefully fail if the given partition is not formatted as swap and
will not do damage. As long as you use it on the computer the floppy
was made for, everything will be as before, as the mkswap isn't needed
there anyway.

Please, pleas fix that!
Thanks.

Of course I'm willing to help, if you can point me where to start.

Greetings,

Sebastian Leske

---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.dk
For additional commands, e-mail: mulinux-help@sunsite.dk



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:19 CET