Moving/Resizing Linux (ext2) partitions with Partition Magic: It works!

Moving/Resizing Linux (ext2) partitions with Partition Magic: It works!

Post by Kenny McCorma » Tue, 15 May 2001 13:34:37



This is a success story - I didn't think it would work, but it did.  I did a
fairly complex set of operations (shrinking the FAT partition, moving the
extended partition, deleting one swap partition - resizing another one, and
moving/resizing the ext2 [Linux boot] partition), all in one Pmagic session,
and it worked just fine.

And here's the thing that's amazing: I did not have to re-run LILO - the
thing just booted up fine.  This totally amazed me, except for the fact that
this was a "LILO in the partition - booted by some other boot manager in the
MBR", rather than a "LILO in the MBR" setup.  So, it appears, Pmagic is
actually smart enough to fix the LILO setup if it is in the partition that
is being resized/moved.

Have I got this all right?  BTW, I've sort of lost my Pmagic documentation;
though in fact, I never really read it anyway - since this is the kind of
program that really should be self-documenting - which I've always found it
to be (translation: I haven't screwed up yet).

 
 
 

Moving/Resizing Linux (ext2) partitions with Partition Magic: It works!

Post by Eric » Tue, 15 May 2001 17:37:35


Quote:> This is a success story - I didn't think it would work, but it did.  I did
a
> fairly complex set of operations (shrinking the FAT partition, moving the
> extended partition, deleting one swap partition - resizing another one,
and
> moving/resizing the ext2 [Linux boot] partition), all in one Pmagic
session,
> and it worked just fine.

> And here's the thing that's amazing: I did not have to re-run LILO - the
> thing just booted up fine.  This totally amazed me, except for the fact
that
> this was a "LILO in the partition - booted by some other boot manager in
the
> MBR", rather than a "LILO in the MBR" setup.  So, it appears, Pmagic is
> actually smart enough to fix the LILO setup if it is in the partition that
> is being resized/moved.

> Have I got this all right?  BTW, I've sort of lost my Pmagic
documentation;
> though in fact, I never really read it anyway - since this is the kind of
> program that really should be self-documenting - which I've always found
it
> to be (translation: I haven't screwed up yet).

Rerun /sbin/lilo now you still have the chance.
PM cannot fix lilo for you. You probably were just lucky that nothing is
overwritten yet. If you want to be sure, fill up / and/or /boot with
(zero-filled) files.
You'll probably need a bootfloppy afterwards. Ofcourse there's also a chance
that
/boot/map (I'm not sure what other files are important) and the kernel
weren't moved.
I don't know the strategy of PM's resizer, nor what you exactly did.

Anyway, run /sbin/lilo and you'll be safe.

Eric

 
 
 

Moving/Resizing Linux (ext2) partitions with Partition Magic: It works!

Post by Rod Smi » Wed, 16 May 2001 07:32:49


[Posted and mailed]



Quote:> This is a success story - I didn't think it would work, but it did.  I did a
> fairly complex set of operations (shrinking the FAT partition, moving the
> extended partition, deleting one swap partition - resizing another one, and
> moving/resizing the ext2 [Linux boot] partition), all in one Pmagic session,
> and it worked just fine.

> And here's the thing that's amazing: I did not have to re-run LILO - the
> thing just booted up fine.  This totally amazed me, except for the fact that
> this was a "LILO in the partition - booted by some other boot manager in the
> MBR", rather than a "LILO in the MBR" setup.  So, it appears, Pmagic is
> actually smart enough to fix the LILO setup if it is in the partition that
> is being resized/moved.

Unless you're using PM 6.0 and they've changed something about it, this
isn't what happened; you just got lucky. As I understand it, LILO will
continue to work after moving or resizing the partition on which the
kernel resides if and only if the kernel hasn't moved. By "the kernel
hasn't moved," I mean that the hard disk sectors that previously held
the kernel continue to hold it. (Actually, I believe a secondary boot
loader file in /boot also must not have moved, by the same definition of
"moved.") Now, it's conceivable that PM did move one or both of those
files, but the sectors that previously held the files haven't been
overwritten by something else. If so, LILO could stop working at any
time. Therefore, you'd do well to type "lilo" as root to re-install it,
just to be sure it works correctly in the future.

Now, that said, if PM 6.0 has added code to analyze an installed LILO
and change it as required if PM moves the kernel, I'd be interested in
hearing about it. Please post if you've heard this is definitely the
case.

--

http://www.rodsbooks.com
Author of books on Linux & multi-OS configuration

 
 
 

Moving/Resizing Linux (ext2) partitions with Partition Magic: It works!

Post by Kenny McCorma » Thu, 17 May 2001 01:16:46




>[Posted and mailed]

(A minor point - but please don't do that.  It only tempts me to respond in
email, when it would be better to respond in the NG)

Quote:>Unless you're using PM 6.0 and they've changed something about it, this
>isn't what happened; you just got lucky.

Yes, of course.  I just had a temporary lack of memory - of course, I knew
about the "LILO continues to work unless/until you overwrite those sectors"
phenomenon.  Its one of those things that makes Linux and LILO neat.

Quote:>Now, that said, if PM 6.0 has added code to analyze an installed LILO
>and change it as required if PM moves the kernel, I'd be interested in
>hearing about it. Please post if you've heard this is definitely the
>case.

I'm using PM 4.0, so I wouldn't know about new features - one of the purpose
of my previous post was to find out about the new bugs and features in PM
since 4.0.

The point of all this, of course, is, as I alluded to in another post/thread,
that PM *could* do the necessary "mopping up" that needs to be done after
moving the partitions around (some of which are listed below), and if it
were a Microsoft application, it would be expected to do so (and, more often
than not, destroy your system in the process):

        1) LILO fixup
        2) fstab fixup (This would have to include all possibly affected
           partitions - boot, usr, home, and swap)