Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Jan 1999 15:07:52 -0500 (EST)
From:      Postman <postman@scitec.com>
To:        freebsd-questions@FreeBSD.ORG
Cc:        cjc@newmail.scitec.com
Subject:   Repartitioning
Message-ID:  <199901082007.PAA07025@newmail.scitec.com>

next in thread | raw e-mail | index | archive | help
I have FreeBSD living in 1 GB. I have a root, usr, and var filesystem. 
Unfortunately, my clairvoyance failed me the day I installed and my 
partitions are not idealing dividing the available space. The usr 
partition is esentially full and var has lots of unused space. My plan 
is to split var into a 'home' and new var partition. var is small enough 
that I can temporarily save it in the root directory.

I think I know how to do this, but I wanted to pass my plan past the
mail list before I lose all my data through some small oversight. My 
plan is to:

1) Copy the old /var to its temporary space keeping the time where I have
   no /var to a minimum.

root# mkdir /var_new
root# cp -Rp /var /var_new
root# umount /var
root# rmdir /var
root# mv /var_new /var

2) Rewrite the disklabel (scary part). This has to be done right!
   To ensure that, this is the file I will give to disklabel. Please
   let me know if there are mistakes.

root# more newlabel
# /dev/rwd0c:
type: ESDI
disk: wd0s2
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 128
sectors/cylinder: 8064
cylinders: 266
sectors/unit: 2145024
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:    65536        0    4.2BSD        0     0     0   # (Cyl.    0 - 8*)
  b:   262144    65536      swap                        # (Cyl.    8*- 40*)
  c:  2145024        0    unused        0     0         # (Cyl.    0 - 265)
# Old entry:
# e:   614400   327680    4.2BSD        0     0     0   # (Cyl.   40*- 116*)
  f:  1202944   942080    4.2BSD        0     0     0   # (Cyl.  116*- 265*)
# New entries:
  e:    38400   327680    4.2BSD        0     0     0   # (Cyl.   40*- ???*)
  g:   576000   366080    4.2BSD        0     0     0   # (Cyl.  ??? - 265)
root# disklabel -R -r wd0 newlabel

3) OK, now the above was scary because if it is messed up, this next 
   step will be disasterous. Put file systems on the new partitions.

root# newfs /dev/wd0s2e
root# newfs /dev/wd0s2g

4) Now move back /var.

root# mv /var /var_tmp
root# mkdir /var
root# mount /var
root# cp -Rp /var_tmp /var

5) That is all of the critical stuff. I'll use the same procedure to
   move /home and then update /etc/fstab.

OK, so what am I missing? What did I screw up? Or where am I totally
off base?

Thanks.

PS: Since I am going to be rewriting my disklabel, is there anything
else that's nice to have that's not there? Specifically, should I
give the volume a label?
-- 
Crist J. Clark                               postman@scitec.com
SciTec, Inc                                  E-Mail Administrator

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901082007.PAA07025>