[PLUG] Adding disk partitions to an existing system

Jeme A Brelin jeme at brelin.net
Thu Jun 13 23:41:55 UTC 2002


On Thu, 13 Jun 2002, Bill wrote:
> 1. Nuke the ntfs partitions and make 4 ext2 partitions
> 2. Move the contents of my existing /tmp and /var directories to two
> of the partitions, then mount the new partitions as /tmp and /var
> 3. Mount another partition off my home directory for more space,
> leaving the last partition to plug in whereever I need space in the
> future.

I'm just preserving this so we all keep the goals in sight when we give
advice.

> I know or can figure out how to play with mtab/fstab to get partitions
> mounted where I need them, and I guess I can use linux's fdisk to get
> rid of the ntfs partitions, but I'm a little confused about how I go
> about reformatting them and getting them ready.

If that wasn't just a typo or if you're already quite familiar with the
stock fdisk, ignore the rest of this paragraph.  I think you'll probably
have better luck with cfdisk than fdisk.  It's got a nicer interface
(full-screen, kinda like MS fdisk) for someone who wants to see what
they're doing as they do it.  Plain fdisk is really for scripts and piping
around variable output... a straight command-line utility.

And I'm sure you can be trusted with your own fstab.  Don't touch mtab,
though, that's all auto-generated.

> And once I have them formatted, would I just mount them at an
> arbitrary location to copy my current /var and /tmp directories over,
> then remove the current /var and /tmp directories?

GNU tar can be run with appropriate switches to preserve symlinks and
permissions.  I'm the sort of person that always has to look 'em up,
though, so let Paul or somebody rattle them off the top of his big ol'
noggin.

> And do I need to go into single user mode to do this kind of fooling
> around, so nothing important is trying to write to nonexistant files
> while the transition is taking place?

Eh... I wouldn't unless it was a production machine (with external users
that rely on constant uptime).  Just stop the obvious services, don't be
running X and try to be as atomic as possible when swapping the new /var
for the old one.

<edit fstab to reflect new mountpoint at /var for /dev/whatever, but
don't actually mount it>
<command to copy contents of var to new location>
rm -rf /var && mount /var

The end.

> Also, I currently have 3 primary and one extended partitions--two
> primary ntfs and one primary ext3 partitions plus an extended
> partition which is entirely occupied by my swap part at hda5:
> 
> hda1 boot partition 	ntfs
> hda2   			ntfs
> hda3			Extended		
> hda4			Linux	
> hda5			Linux swap (in hda3 extended partition)
> 
> Am I gonna run into any hassles because of he number of primary
> partitions? I don't give a rat's tookus about remaining compatable
> with DOS's fdisk, but how many primary partitions can Linux's
> fdisk/mount deal with?

Well, according to the man page, fdisk numbers primary partitions as 1-4
and starts numbering extended partitions at 5.

But that's not reflected in what I see in your email.  Is that right?

> Another question--I have been booting linux off a floppy while doing
> the dual-boot thing--how do I rewrite the boot sector (or whatever
> needs to be rewritten) so as to be able to boot off the hd?

Depends on which bootloader you're using.  If it's lilo, edit
/etc/lilo.conf so that one of the sections reads boot=<your boot device>
and run lilo as root.

Realize that lilo can be configured with its boot block on a particular
partition or in the MBR of the disk.  If you want lilo to install in the
MBR, you've got to give the raw device for the disk (/dev/hda instead of
/dev/hda[0-9]).


Anyway, that's how I'd do things on a home network.
J.
-- 
   -----------------
     Jeme A Brelin
    jeme at brelin.net
   -----------------
 [cc] counter-copyright
 http://www.openlaw.org





More information about the PLUG mailing list