Alexander Cerna
2008-Dec-10 17:42 UTC
[zfs-discuss] what command to zero out unused blocks in zfs pool?
First a background to my problem. I am using a Windows XP Pro laptop to host a VirtualBox OpenSolaris guest. The VDI file is now 30 GB big but a df tells me that the ZFS pool is using only 20 GB. I want to free up that 10 GB. Hold on, I know what you''re thinking, but this is not a VirtualBox problem ultimately. There is a VirtualBox utility that I can use for compacting the VDI file: VBoxManage modifyvdi <VDI_Fully_Qualified_Path> compact, but the problem with this command is that it will only work if the unused blocks are already filled with zeroes, i.e., previously filled with zeroes by the guest OS. And this brings me to my question. What ZFS command (if there is one) will zero out unused blocks in a ZFS pool? I have RTFM-ed and Googled and the closest one I can think of is "pfexec zpool scrub <pool_name>" but this does not zero out unused blocks. Might there be an obscure option to "pfexec zpool scrub <pool_name>" to zero out unused blocks? -- This message posted from opensolaris.org
Tomas Ă–gren
2008-Dec-10 17:45 UTC
[zfs-discuss] what command to zero out unused blocks in zfs pool?
On 10 December, 2008 - Alexander Cerna sent me these 1,1K bytes:> First a background to my problem. I am using a Windows XP Pro laptop > to host a VirtualBox OpenSolaris guest. The VDI file is now 30 GB big > but a df tells me that the ZFS pool is using only 20 GB. I want to > free up that 10 GB. Hold on, I know what you''re thinking, but this is > not a VirtualBox problem ultimately. > > There is a VirtualBox utility that I can use for compacting the VDI > file: VBoxManage modifyvdi <VDI_Fully_Qualified_Path> compact, but the > problem with this command is that it will only work if the unused > blocks are already filled with zeroes, i.e., previously filled with > zeroes by the guest OS. > > And this brings me to my question. What ZFS command (if there is one) > will zero out unused blocks in a ZFS pool? I have RTFM-ed and Googled > and the closest one I can think of is "pfexec zpool scrub <pool_name>" > but this does not zero out unused blocks. > > Might there be an obscure option to "pfexec zpool scrub <pool_name>" > to zero out unused blocks?dd if=/dev/zero of=/yourfs/bigemptyfile bs=1024k (just make sure compression is off on yourfs) :) /Tomas -- Tomas ?gren, stric at acc.umu.se, http://www.acc.umu.se/~stric/ |- Student at Computing Science, University of Ume? `- Sysadmin at {cs,acc}.umu.se