# mv: rename src to src-no: Operation not supported



## ziomario (Aug 14, 2022)

Hello.

can someone tell me why I can't rename the src folder ? When I try to do that,it gives the error "operation not supported". I've messed up its content and I would like to copy and paste the content I have on another FreeBSD system,which works good. (the two installations are both based on the 13.1-RELEASE)


```
mario@marietto:/mnt/freebsd-zfs/usr # mv src src-no
mv: rename src to src-no: Operation not supported
```


----------



## Geezer (Aug 14, 2022)

Because /usr/src is on its own mount point.


----------



## angry_vincent (Aug 14, 2022)

zfs rename is the way for that, so
zfs rename /usr/src /usr/src-no


----------



## T-Daemon (Aug 14, 2022)

angry_vincent said:


> zfs rename is the way for that, so
> zfs rename /usr/src /usr/src-no


zfs-rename(8) renames ZFS datasets, not mount points. The correct way to rename /usr/src would be:

`zfs rename zroot/usr/src zroot/usr/src-no`


----------



## angry_vincent (Aug 14, 2022)

that's what meant, yes, thx for correction


----------



## ziomario (Aug 14, 2022)

I've been able to rename the src directory to src-no with this command :


```
zfs rename zroot/usr/src zroot/usr/src-no
```

but for some unknown reason,now I have an empty folder located on /usr called src-. Wnen I try to remove it,it says : *error removing file : device busy.* Why ? How can I remove this empty directory ?


----------



## Phishfry (Aug 14, 2022)

As @infostud told you on reddit:


> Probably a noschg flag set.








						Cannot delete it.... - DaemonForums
					

Cannot delete it.... FreeBSD General



					daemonforums.org


----------



## Phishfry (Aug 15, 2022)

There is also the possibility they are ZFS datasets.








						rm -rf /usr/src and /usr/ports
					

Hello,  Installed FreeBSD-11.1 on USB 3.0 external hard drive with root ZFS+GELI, tried to run rm -rf /usr/src and rm -rf /usr/ports and it return back 'Device busy'.  I deleted those directories after unmount /usr/src and /usr/ports, is it correct?




					forums.freebsd.org


----------



## ziomario (Aug 15, 2022)

------> if you really want to delete them, destroy the ZFS dataset and recreate them.

I'm frozen here. I'm not sure if I can destroy the ZFS dataset on the main FreeBSD system.


----------



## cy@ (Aug 16, 2022)

ziomario said:


> I've been able to rename the src directory to src-no with this command :
> 
> 
> ```
> ...


Do you have another mountpoint just below the one you just umounted? In this case you might want to try a df | grep <MOUNTPOINT>. If you see the same mountpoint more than once you have them stacked over each other.


----------



## T-Daemon (Aug 16, 2022)

ziomario said:


> but for some unknown reason,now I have an empty folder located on /usr called src-. Wnen I try to remove it,it says : *error removing file : device busy.* Why ? How can I remove this empty directory ?


The error message sounds like trying to remove a ZFS datasets mount point with rm(1).



ziomario said:


> ------> if you really want to delete them, destroy the ZFS dataset and recreate them.
> 
> I'm frozen here. I'm not sure if I can destroy the ZFS dataset on the main FreeBSD system.


Sure you can. You would be destroying a dataset ( zroot/usr/src- ), unimportant to the "main FreeBSD system" (which is a different dataset under many others, when installed Root-on-ZFS by the FreeBSD installer).


----------



## drhowarddrfine (Aug 16, 2022)

Let's keep our terminology straight. These are directories and not "folders".


----------

