[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Clean deleted space in linux diks?

James Pifer wrote:
 > Either you are doing a block level volume copy (in which case you'll
 need to erase free space only), or you are doing a file copy in which
 case you'll start with an empty virtual volume which will expand in
 storage requirements as you copy files.


Just to recap, I am trying to erase the free space only. I assume the
new SAN is doing a block level copy, which is why it consumes the whole
space. Once I erase the free space there is a reclamation process on the
SAN that will make the disk thin/sparse.

Yes, if I take a newly created thin disk, and do a file level restore or
copy, the disk remains thin.

For this example I have a disk called xvda. It has two partitions:
xvda1 (swap)
xvda2 (system)

I would like to erase the free space on xvda2, which is running on
sles11 with ext3.

Several things were mentioned. If you don't mind repeating, what do you
feel is the final solution?

My apologies, I mixed up who said what. Niels gave you information on erasing an entire partition (ie nuke the entire filesystem as well), I gave you information on erasing free space only.

If I were doing it, I'd do one of these :

If there's a lot of free space and making huge files may be an issue

a=0 ; while [ $a -lt X ]
  dd if=/dev/zero of=null-file-$a bs=1024k count=1024
rm null-file*
X needs to be > amount of free space in GBytes.

If there isn't a huge amount of free space and/or making one big file isn't an issue.
dd if=/dev/zero of=null-file bs=1024k ; rm null-file
cat /dev/zero > null-file ; rm null-file

Both of these will write nulls into file(s) until the filesystem is full, then delete them. Depending on the space involved, they may take some time, and to avoid problems if anything tries to write a file while the disk is full you should stop as many processes as possible.

Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

Xen-users mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.