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

Re: De-activate a swap partition - I don't believe it!



On Monday 20 March 2006 03:28, jdow wrote:
>
> It sounds like Anne committed one or more of the death penalty sins for
> working with operating systems and file systems in particular.
>
> NEVER EVER repartition an active drive. Your data is likely toast.
> NEVER EVER repartition a drive without taking a backup first.
> NEVER EVER use a partitioning tool without understanding what it is going
>            to do to you, in detail.
>
> In any case somebody who is VERY careful to dismount partitions (at least
> ones that are going to be changed), can get away with repartitioning an
> active disk. 

All partitions on that drive were dismounted.  There were no system partitions 
apart from a swap partition which had been turned off.

> It is like juggling weeping sticks of dynamite, though. In 
> general drop to single user mode, backup all data on the drive you're going
> to mess with, then mess with the drive after completely dismounting it,
> every one of its partitions. The Linux Documentation Project is a good
> place to find HOW-TO help on this sort of thing. And, really, if the
> HOW-TOs leave you baffled you're not ready to play with a given feature.
> (Hint, there is at least partitioning HOW-TO with some hints on where the
> swap files ought to go. Three partitions are usually called for. /boot, 
> /, and swap. Ordering depends on the performance you need. If you go to
> swap a lot - put it near the outside of the disk. If you do not go to swap
> at all often then put it anywhere you want, it'll not make a huge
> difference.)
>
That's what I thought.  It should be rare that I use it, but it provides 
additional, quickly available swap if necessary.

> > Sometimes the kernel sees one partition table, and when changes are made
> > it *requires* a reboot to see the new table.  Sometimes it sees the
> > change without a reboot.  I have not really figured out the differences,
> > but I do know that after a reboot it will see the current table
> > correctly.
>
> THAT is a fine way to destroy partitions that might have been saved if they
> are still mounted.
>
> I learned WAY WAY WAY more about partition tables than I ever wanted by
> embracing Anne's folly. <sigh - I am human.> Had I not rebooted I could
> probably have found the kernel's records of the partitions it was using.
> As it was I had to learn about ext2fs's disk organization and recover
> the hard way. It was a long job even though I remembered the basics of
> the partitioning. NOW I make a print out of an "fdisk -l". I keep a sane
> fdisk around, too. New ones are broken. They have an artificial limit on
> the number of partitions they will handle. I have had times I really had
> serious use for about 24 partitions on one disk. I do NOT like tools that
> make artificial limits. (I have some read only partition images I use
> from time to time for some "ancient archives" work. I try not to EVER
> lose data. And given a choice it will be available for me when I want it.)
>
I'm not completely daft, J ;-)  I had a printout of df -h and fdisk -l before 
I started.  I could create the whole partition table based on that if I 
needed to.  The more I think about it, though, and the more I suspect it is 
the wrong thing to do.  It's just making work.  I had intended to reorganise 
the data that resides in just one of those partitions to match the structure 
in hda, then use rsync to create a data backup.  It would be easier to do 
that from one large empty partition.

> Anyway, with the fdisk -l listing I can generally recover from blunders
> pretty easily as long as I do not try to take too many of the "fdisk" and
> "makefs" steps at once. It's ALWAYS painful. Do it all one careful step
> at a time and check the work at each step. And "please" do it in single
> user mode. You'll find it is easier on your nerves.
>
> {o.o}   <- When I embrace folly I try to turn it into a learning
> experience. Learning is a nasty experience. Having learned is rather fun.

For me, the fear before I start is the nasty bit.  Once I take the first step 
I stop panicking and cope.  If, like this time, I can take time to assess the 
situation properly it's not scarey.  If there is pressure for a fast result, 
then I'm worried.

Anne

Attachment: pgpIdcBqsO7Tl.pgp
Description: PGP signature


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