My current /usr file system was full, so I ended up adding a new disk to my FreeBSD server. I've created a new partition at /dev/ad6s1 (size is 250G). How do I move my /usr file system over to my huge new disk at /dev/ad6s1?
First, you need to partition and label the new disk with either sysinstall, or fdisk and disklabel. The procedure to add a new hard disk under FreeBSD is discussed here.
Once new disk added, create a temporary mount point to mount your /dev/ad6s1, enter:
# mkdir /newuser
Reboot and drop system to a signal user mode to migrate to a new disk:
# reboot
At boot prompt type:
# boot -s
Mount all file systems:
# mount -a -t ufs
Mount new /newuser file system:
# mount /dev/ad6s1 /newuser
Copy old /usr to /newuser:
# cd /newuser
# dump 0af - /usr | restore rf -
Sample outputs:
Open /etc/fstab, enter:
# vi /etc/fstabModify /usr entry to point to a new location:
/dev/ad6s1 /usr ufs rw 2 2
Save and close the file. Reboot the server:
# reboot
Make sure everything is working fine after reboot:
# df -H
# tail -f /var/log/messages
Recommend readings:
- man pages dump, fstab, mount, restore
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- My 10 UNIX Command Line Mistakes
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
- Email FAQ to a friend
- Download PDF version
- Printable version
- Comment RSS feed
- Last Updated: 11/7/09




{ 4 comments… read them below or add one }
Awww.. /usr has nothing to do with “user”.. It’s “Unix System Ressources”.
when i type # mount /dev/ad1s1 /new
it returns a ‘mount: /dev/ad1s1 invalid argument’ error.
Make sure /dev/ad1s1 exists and formatted.
you can use fdisk, bsdlabel & newfs without sysinstall
# fdisk -BIq /dev/ad1
# bsdlabel -w -B /dev/ad1s1 auto
# newfs /dev/ad1s1a
# mount /dev/ad1s1a /mnt