Find out Hard Disk position on FreeBSD

I just replace first HD in our email server with new one, little HD to replace 500GB HD 🙂
Until I forgot to copy important file in old HD to new one.
My friend ask me to show my way to find out hard disk location in FreeBSD.

System layout before put old HD :

email# df -H
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ad4s1a    2.1G     40M    1.9G     2%    /
devfs          1.0k    1.0k      0B   100%    /dev
/dev/ad4s1d     21G    403k     19G     0%    /home
/dev/ad4s1f     40G    2.0G     35G     5%    /usr
/dev/ad4s1e     10G     60M    9.5G     1%    /var
/dev/ad5s1d    484G    102G    344G    23%    /email
/dev/ad6s1d    484G    3.8G    442G     1%    /email2

My first method is : dmesg

email# dmesg
ad4: 76319MB <Seagate ST380215AS 4.AAB> at ata2-master SATA150
ad5: 476940MB <Seagate ST3500320AS SD15> at ata2-slave SATA150
ad6: 476940MB <Seagate ST3500630AS 3.AAK> at ata3-master SATA150
ad7: 476940MB <Seagate ST3500320AS SD15> at ata3-slave SATA150

Yes, ad7. Last added HD detected as ad7

Second method : sysinstall

sysinstall -> configure – > pilih Fdisk

| |                          [ ] ad4  ad4                           ¦ ¦
¦ ¦                          [ ] ad5  ad5                           ¦ ¦
¦ ¦                          [ ] ad6  ad6                           ¦ ¦
¦ ¦                          [ ] ad7  ad7

Yes, as seen its in ad7.

Make temporary folder for mounting purpose :

email# mkdir /home_old
email# mkdir /usr_old
email# mkdir /var_old

mounting it to created temporary folder :

email# mount -t ufs /dev/ad7s1d /home_old
email# mount -t ufs /dev/ad7s1f /usr_old
email# mount -t ufs /dev/ad7s1e /var_old

see mounted partitions :

email# mount
/dev/ad4s1a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/ad4s1d on /home (ufs, local, soft-updates)
/dev/ad4s1f on /usr (ufs, local, soft-updates)
/dev/ad4s1e on /var (ufs, local, soft-updates)
/dev/ad5s1d on /email (ufs, local, soft-updates)
/dev/ad6s1d on /email2 (ufs, local, soft-updates)
/dev/ad7s1d on /home_old (ufs, local, soft-updates)
/dev/ad7s1f on /usr_old (ufs, local, soft-updates)
/dev/ad7s1e on /var_old (ufs, local, soft-updates)

Yes, copy paste operation ready to set 🙂

Tags: