rm -rf /usr/ports itself, only its contents. You would need to use zfs destroy to actually remove the /usr/ports/ directory itself. Not needed if you just want to checkout a new ports tree. Just remove its contents, not the directory itself.What is the output of df -h and mount -p commands?
$ sudo df -h
Filesystem Size Used Avail Capacity Mounted on
zroot/ROOT/default 113G 3.6G 109G 3% /
devfs 1.0K 1.0K 0B 100% /dev
procfs 4.0K 4.0K 0B 100% /proc
zroot/var/tmp 109G 104K 109G 0% /var/tmp
zroot/usr/home 109G 41M 109G 0% /usr/home
zroot/var/log 109G 464K 109G 0% /var/log
zroot/tmp 109G 112K 109G 0% /tmp
zroot/var/crash 109G 96K 109G 0% /var/crash
zroot 109G 96K 109G 0% /zroot
zroot/usr/src 110G 727M 109G 1% /usr/src
zroot/var/audit 109G 96K 109G 0% /var/audit
zroot/var/mail 109G 120K 109G 0% /var/mail
zroot/usr/ports 110G 716M 109G 1% /usr/ports
$ sudo mount -p
zroot/ROOT/default / zfs rw,noatime,nfsv4acls 0 0
devfs /dev devfs rw 0 0
procfs /proc procfs rw 0 0
zroot/var/tmp /var/tmp zfs rw,nosuid,noatime,nfsv4acls 0 0
zroot/usr/home /usr/home zfs rw,noatime,nfsv4acls 0 0
zroot/var/log /var/log zfs rw,noexec,nosuid,noatime,nfsv4acls 0 0
zroot/tmp /tmp zfs rw,nosuid,noatime,nfsv4acls 0 0
zroot/var/crash /var/crash zfs rw,noexec,nosuid,noatime,nfsv4acls 0 0
zroot /zroot zfs rw,noatime,nfsv4acls 0 0
zroot/usr/src /usr/src zfs rw,noatime,nfsv4acls 0 0
zroot/var/audit /var/audit zfs rw,noexec,nosuid,noatime,nfsv4acls 0 0
zroot/var/mail /var/mail zfs rw,nfsv4acls 0 0
zroot/usr/ports /usr/ports zfs rw,nosuid,noatime,nfsv4acls 0 0
$ sudo fstat | grep "/usr/ports"fstat | grep "/usr/ports"
Oh no wonder I cannot use the rm -rf /usr/ports command on my zfs.Maybe you have some other session logging in that's in that directory?
Also note, with a ZFS install, /usr/ports is a separate filesystem, which means you can'trm -rf /usr/portsitself, only its contents. You would need to usezfs destroyto actually remove the /usr/ports/ directory itself. Not needed if you just want to checkout a new ports tree. Just remove its contents, not the directory itself.
There is no need to destroy the dataset, just runSo how do i zfs destroy, /usr/ports???
rm -rf /usr/ports/* /usr/ports/.svn as SirDice suggested:... usezfs destroyto actually remove the /usr/ports/ directory itself. Not needed if you just want to checkout a new ports tree. Just remove its contents, not the directory itself.
The /usr/ports is a ZFS dataset.Hi
Currently I am using FreeBSD 12.2.
I wanted to delete the /usr/ports and download the svnweb subversion.
How do I go about doing that???
Please help.
Thank you.
rm -rf /usr/ports command you HAVE a clean /usr/ports directory, but you can not delete that directory because its ZFS dataset. Do delete ZFS dataset you will have to use zfs destroy zroot/usr/ports command, but as you are saying that you want to fetch a fresh copy of Ports then you only need this:# rm -rf /usr/ports
# portsnap auto
$ sudo fstat | grep "/usr/ports"
rusli sh 886 wd /usr/ports 34 drwxr-xr-x 85 r
kill -9 886 to kill that process which accesses /usr/ports, then destroy that zfs dataset as recommended above