[PLUG] Adding disk partitions to an existing system
Jeme A Brelin
jeme at brelin.net
Fri Jun 14 01:26:32 UTC 2002
On Thu, 13 Jun 2002, Bill wrote:
> On Thu, 13 Jun 2002, Jeme A Brelin wrote:
> Jeme and other helpful souls
I'm not sure if the word "other" is appropriate here.
> I now have
>
> (output from fdisk -l)
> Disk /dev/hda: 128 heads, 63 sectors, 969 cylinders
> Units = cylinders of 8064 * 512 bytes
>
> Device Boot Start End Blocks Id System
> /dev/hda1 919 969 205632 82 Linux swap
> /dev/hda2 1 406 1636960+ 5 Extended
> /dev/hda4 * 407 918 2064384 83 Linux
> /dev/hda5 * 1 194 782145 83 Linux
> /dev/hda6 195 267 294304+ 83 Linux
> /dev/hda7 268 340 294304+ 83 Linux
> /dev/hda8 341 406 266080+ 83 Linux
Again, for the purpose of consistent, on-topic followups, I'll recap.
/dev/hda4 is mounted as /, /dev/hda1 is swap. /dev/hda5-8 are new and
contain nothing useful.
What's /dev/hda2 again?
> Now, what do I do to get my new linux partitions (hda5-8) formatted as
> ext2?
Most basically?
mkfs -t ext2 /dev/hda5
If, for some reason, you don't have a mkfs script, you can do
mkfs.ext2 /dev/hda5
or
mke2fs /dev/hda5
and that should work.
> I know this sounds ignorant, but I am a bit puzzled.
Ignorance is ok. At least you CAN learn. There are many less fortunate
than yourself.
> Also, what is the preferred method for copying whole directories,
> since I wanna get the entire current contents of /var and /tmp into
> hda6&7, and presumably permissions and symlinks gotta stay absolutely
> the same?
mount /dev/hda5 /mnt
tar clpsvC /tmp .|tar xlpsv /mnt
Should that do it?
I haven't tested that. Don't trust me.
> I understand that once I have the formatting and copying done, I can
> update /etc/fstab and
> rm -rf /tmp && mount /tmp
> or do i need
> rm -rf /tmp && mkdir /tmp && mount /tmp
> to make the directory where I'm a-gonna mount the new partition?
Heh. Caught me there. Yeah, you'll have to mkdir the damned thing first.
But as was pointed out earlier, you don't have to blow away the contents
before mounting something on top. mount will just make the new mountpoint
and ignore any other pointers to data in /tmp that isn't at the new
mountpoint. Does that make sense?
So you can have something like this:
Host:/$ ls /tmp
foo
bar
Host:/$ mount /dev/hdb2 /tmp
Host:/$ ls /tmp
baz
Host:/$ umount /tmp
Host:/$ ls /tmp
foo
bar
Dig?
So you can do the rm after you know everything works.
J.
--
-----------------
Jeme A Brelin
jeme at brelin.net
-----------------
[cc] counter-copyright
http://www.openlaw.org
More information about the PLUG
mailing list