Open ChaseTheDark opened 7 months ago
If I were to guess, you have all the contents of the filesystem zpool/PVE
also stored in the folder "PVE" on the filesystem `zpool", not just in the filesystem "zpool/PVE" currently mounted there.
If I were to guess, you have all the contents of the filesystem
zpool/PVE
also stored in the folder "PVE" on the filesystem `zpool", not just in the filesystem "zpool/PVE" currently mounted there.
I agree with your speculation. I also believe that's the case, but currently, I can't access my original 1.49TB data by any means, and the 'du' command shows the space usage correctly.
$ du -sh /zpool/*
129M /zpool/backup
1.5T /zpool/PVE
------
$ du -sh /zpool/.zfs
0 /zpool/.zfs
In fact, I think the problem occurred with the commands I used initially:
zfs snapshot zpool@firstSnapshot
zfs destroy zpool@firstSnapshot
......
zfs destroy -r zpool/PVE
......
zfs snapshot zpool@firstSnapshot
......
After initially deleting 'zpool/PVE', my data didn't immediately disappear when I checked at that time. That's why I continued setting other properties instead of immediately restoring files.
Furthermore, something strange happened. After losing my data, I tried using the command 'zfs rollback -r zpool@firstSnapshot'. It didn't return any errors, but it also didn't restore any files. I eventually recovered my data using the 'cp' command after finding 'zpool/.zfs'.I suspected that the space occupation was related to my snapshot, so I deleted the zpool@firstSnapshot.
So, if you have data in the folder "PVE" under the dataset zpool/
, then you could unmount the dataset zpool/PVE
, to access the contents of the place where it was mounted, e.g. zfs umount zpool/PVE
So, if you have data in the folder "PVE" under the dataset , then you could unmount the dataset , to access the contents of the place where it was mounted, e.g.
zpool/``zpool/PVE``zfs umount zpool/PVE
I see, indeed, there are two mount points. However, even after using "zfs umount zpool/PVE," the space still wasn't released.
Let me clarify my space usage:
zpool: Occupies 2.99TB, with subdataset using 1.5TB, and itself using 1.49TB.
I wasn't saying it would be released if you did that, I was saying that it would be visible for you to delete then.
It may become clearer to you what can be done if you change the mountpoint of zpool/PVE
to, say, /zpool/PVE_dataset
, then look at the space usage with du -sh /zpool/
versus du -shx /zpool/
.
du -x
can also tell you how much space without crossing into things mounted under it.
I wasn't saying it would be released if you did that, I was saying that it would be visible for you to delete then.
It may become clearer to you what can be done if you change the mountpoint of to, say, , then look at the space usage with versus .zpool/PVE/zpool/PVE_datasetdu -sh /zpool/du -shx /zpool/
du -x can also tell you how much space without crossing into things mounted under it./zpool/
`du -shx /zpool/
I changed the mount point of ”zpool/PVE“. Here are my subsequent observations:
$ df -h
Filesystem Size Used Avail Use% Mounted on
......
zpool 13T 1.5T 12T 12% /zpool
......
zpool/PVE 13T 1.5T 12T 12% /zpool/PVE_dataset
$ du -sh /zpool/
3.0T /zpool/
$ zfs list -t all -o space
NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD
zpool 11.4T 2.99T 0B 1.49T 0B 1.50T
zpool/PVE 11.4T 1.50T 202K 1.50T 0B 0B
zpool/PVE@PVE-2024.03.29 - 202K - - - -
$ du -sh /zpool/*
129M /zpool/backup
1.5T /zpool/PVE
1.5T /zpool/PVE_dataset
$ du -shx /zpool/
1.5T /zpool/
Yes.
You can see now how /zpool/PVE
says it contains 1.5T of data.
You can delete that, if all of it is in /zpool/PVE_dataset
.
Yes.
You can see now how
/zpool/PVE
says it contains 1.5T of data.You can delete that, if all of it is in
/zpool/PVE_dataset
.
I want to release the space occupied by the 1.49TB dataset rather than the 1.5TB one. In fact, the extra 0.01TB of data was added by me to distinguish between my current data and the previous data.
Yes.
You currently have the copy of the data you care about in /zpool/PVE_dataset
, and the copy you do not in /zpool/PVE
.
You have an rm command. You can use it.
System information
Describe the problem you're observing
After deleting a snapshot, I noticed that my space wasn't released and there were no signs of it being released.
Initially, I loaded a lot of data into zpool/PVE and then started setting up my ZFS. Here are the commands I used initially.
I am a complete ZFS novice, and after running the above commands, I found that I lost my data, and attempts to roll back were ineffective.zfs rollback -r zpool@firstSnapshot
Luckily, I eventually found my files in a hidden folder.Before retrieving my files, I used the command zfs list to view my datasets. There were two: zpool and zpool/PVE.
Normally, space should be released after deleting the snapshot zpool@firstSnapshot, but it didn't happen. Below is some information I checked. Note: There are only about 100MB of files in the directory 'zpool/'.
zfs list -t all -o space
du -sh /zpool
zfs get all
zpool get all
zpool status