On Mon, Jul 07, 2003 at 02:57:28PM +0000, Mark wrote:
> Ok, I bought a new 80G hard disk, for backups. I added it on the second IDE.
> But now, when I ran FDISK and the Label program (booted from CD), it will
> not allow me to just add /backup as mount point, and says it wants a root +
> swap partition too. :( I did "W" when writing out the info, but still,
> /etc/fstab is unchanged.
> All I want is to add the new hard disk as mount point /backup. Please, tell
> me how to do this.

When you say "booted from CD" I take it you're using sysinstall(8).
That makes certain assumptions like "you're going to install a FreeBSD
system on this disk".

Instead of working through sysinstall, you can use the fdisk(8) and
disklabel(8) tools from the command line.  Assuming your new drive is
ad4 and you want to use it all for FreeBSD, but that you don't want it
to be bootable:

    # fdisk -I ad4
    # disklabel -w ad4s1 auto

That will give you a default partition layout.  Now you need to re-run
disklabel in partition editing mode. Run

    # disklabel -e ad4s1

and create one big slice 'a' that covers the whole of the disk, by
editing the list of partitions at the end of the disklabel.  Copy the
numbers from the 'c' slice.  You should end up with something like:

    # /dev/ad4s1c:
    type: ATA
    disk: ad4s1
    bytes/sector: 512
    sectors/track: nn
    tracks/cylinder: nnn
    sectors/cylinder: nnnnn
    cylinders: nnnn
    sectors/unit: sssssssss
    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: sssssssss       0    4.2BSD     1024  8192    16   # (Cyl.    0 - nnnn*)
      c: sssssssss       0    unused        0     0         # (Cyl.    0 - nnnn*)

(where you need to replace sssssssss with the number of sectors/unit
that's correct for your disk -- it should appear automatically in the
entry for slice c:)

Now, create a filesystem on your new slice:    

    # newfs -U /dev/ad4s1a

Edit /etc/fstab to add a line for the mount point data for the new

    /dev/ad4s1a  /backups  ufs  rw  2  2

and finally mount the new partition:

    # mount /backups



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to