I am trying to run zerofree on virtualbox .vdi disk. I attached the vdi disk to the storage to another virtual machine - debian desktop. I started the machine and mounted the hard disk with this command: mount -o ro /dev/sdb1 /home/user/mnt. But then if i try to run zerofree /dev/sdb1/
i get zerofree: failed to open filesystem /home/user/mnt/
Why i am getting this error?
/home/user/mnt/
does not exist at the location you specified in your command.vbox@debian:~$ mount | grep sdb1 /dev/sdb1 on /home/user/mnt type ext4 (ro,relatime,data=ordered)
/deb/sdb1
and in your comment your checking/dev/sdb1
I assumed this was a typo but I want to be sure. You have the device mounted read only which you have to do withzerofree
so I would check to see if are running the command with root(sudo) privileges and that you are specifying the device correctly and that it is mounted correctly.sudo zerofree /dev/sdb1
instead ofsudo zerofree /home/user/mnt/
.