UFS Need help on using vi

Ok I have been stuck for a week now. I added a second SATA hdd for squid. My pfsense 2.3-RELEASE (amd64) is working fine.

I followed https://www.freebsd.org/doc/handbook/disks-adding.html and reached the stage where a file system is created in the new partition on the new disk # newfs -U /dev/ada1p1

Next I tried to create a mount point using # mkdir /squidcache. It is telling me that the file exists. So I tried # mkdir squidcache and that seems to work. I get the following using command ls -1 .cshrc .gitsync_merge.sample . hushlogin .login .profile .shrc .tcshrc squidcache

Note that squidcache is without the dot like others. I think that is ok since I read those with dots are hidden system files.

So the next step will be to add an entry to /etc/fstab so the new disk will be mounted automatically at startup
/dev/ada1p1    /squidcache    ufs    rw    2    2

Problem is how do I use vi? Where and what command I should type? Help.
The base system includes ee(1), which is much easier to use than vi(1).

It would be good to get a handle on relative versus absolute paths before modifying /etc/fstab.
I tried vi /etc/fstab several times and had to reinstall pfsense that many times. I think I can manage vi commands (i, :, esc, w, q, set verbose showmode) as I only needed a few to achieve my aim. I realised my other problem is the way my screen displays the output of vi /etc/fstab - see image. Text does not line up with column headers below:-
# Device     Mountpoint     FStype  Options     Dump    Pass#
So how do add the following text in fstab:-
/dev/ada1p1 /newdisk ufs rw 2 2
Do I just type it separated by spacebar? I tried that, save fstab and run vi /etc/fstab the result is exactly as I have typed which is not in line with headers and the default texts in fstab.

I must be really dumb as I have NO idea how to do this. Help.


  • IMG_0628.JPG
    732.1 KB · Views: 168
Does the mount actually work as shown? Test it: mount /dev/ada1p1 /newdisk.

A non-working path in /etc/fstab will cause booting to fail.

When it fails to boot, don't use the "windows solution". Remount the main partition with mount -u / and remove the bad line from /etc/fstab. Then it will boot.