4

I'm getting issues when mounting my zpool. Some zfs aren't mounting because "directory exists", aka the subfolders that the subdataset is stored in. Such as tank/media/movies. It says that that /tank/media/movies exists, so the mount fails. So to safely delete all these directories, I want to unmount all zfs file systems.

But zfs doesn't have a recursive unmount option. So I was just going to run a 1-liner.

zfs list -o name | grep -v NAME | awk '{print $1}' | xargs sudo zfs unmount

But I get the error too many arguments. I think it's because it's printing them all on one line. Cause when I do the same, but instead of sudo zfs unmount I do echo instead, it echos it all on one line.

How can I unmount all zfs file systems?

cclloyd
  • 882

1 Answers1

5

Use zpool export instead. It makes sure that nothing in the pool is currently being referenced, giving the maximum safety for the deletion you want to run.

Dan
  • 1,118