1

Debian 9 (stretch) with ZFS 0.7.12 on kernel 4.15.18-9-pve. I have a ZFS pool with a dataset:

zfs list
NAME                       USED  AVAIL  REFER  MOUNTPOINT
rpool                     2.81T  39.3T   120K  /rpool
rpool/data                2.81T  39.3T    96K  /rpool/data
rpool/data/vm-101-disk-0  7.74G  39.3T  7.74G  -
rpool/data/vm-102-disk-0  5.62G  39.3T  5.62G  -
rpool/data/vm-102-disk-1  2.82T  39.3T  2.82T  -

mount -t zfs
/rpool on /rpool type zfs (rw,xattr,noacl)
/rpool/data on /rpool/data type zfs (rw,xattr,noacl)

For a short while I had a dataset at rpool/store, too, with some files and directories stored in /rpool/store but I used zfs destroy rpool/store to remove it.

I now find I have a copy of the directory structure still at /rpool/store:

ls /rpool/store/
dump  images  private  template

I tried to remove them but to no avail:

rm -rf /rpool/store
ls /rpool/store/
dump  images  private  template

If I ignore this situation and try to recreate my store dataset I get this error:

zfs create rpool/store
cannot mount '/rpool/store': directory is not empty
filesystem successfully created, but not mounted

How do I remove the files and directories at /rpool/store?

  • 1
    Do attempts to rename the store directory fail as well? – dhag Dec 22 '18 at 1:47
  • 1
    does rm -rf /rpool/store emit any error messages? – Jeff Schaller Dec 22 '18 at 2:15
  • 1
    without the -f maybe, to have a chance to read the error? – A.B Dec 22 '18 at 3:18
  • Well that was interesting. cd /rpool; ls gives data store as described. mv store junk; rm -rf junk deletes the problem directory. Thank you all three of you. Who wants the points, or should I write up my own answer? – roaima Dec 22 '18 at 10:08
0

Well that was interesting. Working from the suggestions in the comments, this deleted the problem directory where a straightforward rm -rf store generated no error message but would not delete:

cd /rpool
mv store junk
rm -rf junk

I have no idea why this should have worked when the other did not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.