Installing a second hard disk

John Nielsen lists at
Tue Mar 13 19:25:29 UTC 2007

On Tuesday 13 March 2007 13:05, Aitor San Juan wrote:
> Hi List,
> I am trying to install a secondary hard disk in a Intel-based PC
> with FreeBSD 5.4
> This secondary disk's capacity is 250 Gb. When I enter sysintall
> to try to format it and create a slice, FreeBSD says that the
> geometry of disk is not correct. I, then, type in the values detected
> by the BIOS as suggested, but FreeBSD still complains that those
> are not valid. FreeBSD sees the new disk as a disk of approx. 131 GB.
> So my question is: where is the problem? Is it that FreeBSD is not
> able to recognise such a big disk capacity?
> Any hint, suggestion, or web link would be highly appreciated.

Assuming the new disk is ad4, and you want a single FreeBSD slice/partition/FS 
covering the whole disk:

fdisk -BI /dev/ad4
bsdlabel -wB /dev/ad4s1
newfs -U /dev/ad4s1a

See the manpages for each command for more details. The -B flags aren't 
necessary if you never plan to boot from the new disk, but they don't hurt 
anything either. If you want multiple FreeBSD partitions you could run 
a "bsdlabel -e" after the first bsdlabel command above, and additional newfs 
commands as appropriate.

Continuing the example above, you could do:

mkdir /newdisk
mount /dev/ad4s1a /newdisk
echo "/dev/ad4s1a	/newdisk	ufs	rw	2	2" >> /etc/fstab

To both mount the new filesystem and have it mounted automatically at boot. 
See the fstab manpage for details about that. (You could of course use a text 
editor to modify fstab instead of the echo command above.)


More information about the freebsd-questions mailing list