Disk size

Hi,

Running XEN on SLES11sp3. My disk setup is a block of 100GB of which 25GB is used. I want to shrink the disk to about 50GB. Any ideas of what to use to adjust the partition without losing the data?

Regards
John

John Gill wrote:
[color=blue]

Running XEN on SLES11sp3. My disk setup is a block of 100GB of which
25GB is used. I want to shrink the disk to about 50GB. Any ideas of
what to use to adjust the partition without losing the data?[/color]

What is this 100 GB block? 25 GB is used but how much is allocated?

Is it storage assigned to a DomU or storage used by Dom0?

What other information do you think would be helpful in trying to
assess the situation?


Kevin Boyle - Knowledge Partner
If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

Hey Kevin,

From the host I set aside 105GB for use by the VM. On the VM I partitioned the space as follows:
/dev/xvda 105GB
/dev/xvda1 1GB Ext3 /boot
/dev/xvda2 4GB Swap swap
/dev/xvda3 100GB Ext3 /

The server is running Groupwise Mobility and I am using 25GB of space. I would like to shrink the partition to about 50GB cos when I make a backup of the image I am copying 50GB of empty space :frowning: I am not concerned about reclaiming the space for the host.

The more I think about this, the more I think I should create a new VM and reinstall GMS …

Regards
John

John Gill wrote:
[color=blue]

The more I think about this, the more I think I should create a new VM
and reinstall GMS …[/color]

That’s one option, but as long as you have a backup you could try to
resize the filesystem and expand your Linux skills in the process.

This is a good place to start:
https://www.suse.com/documentation/sles11/stor_admin/data/biuymaa.html


Kevin Boyle - Knowledge Partner
If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

mmmh, I tried to implement the changes according to the documentation, but no joy. I tried various hacks, trickery and magic but no go. I did cause some issues on the VM but a simple reboot of the VM and all was restored. The biggest issue was trying to umount /dev/xvda3. So I suspect the resize is not possible with the way I have setup the VM disks, but I am impressed that I could NOT break the VM (I guess I could hit it with a big hammer but then I would need more hardware :o )

John Gill wrote:
[color=blue]

The biggest issue was trying to umount /dev/xvda3.[/color]

Of course… :wink:

When you resize an ext3 filesystem, you can increase the size while it
is online but you can only decrease the size when it is offline. If you
think about it, it only makes sense that you can’t umount the
filesystem while you are using it.

It would be nice if there were a step-by-step set of instructions to
accomplish what you want but unfortunately I have not been able to
locate any.

Shrinking the root filesystem usually involves booting from a “live” CD
or booting into the rescue system. This becomes more difficult when it
involves a paravirtual DomU. A better solution is to do it from Dom0.

There are several TIDS that discuss how to access a DomU disk from
Dom0. I find they all come up a bit short.

http://www.novell.com/support/kb/doc.php?id=3756370
http://www.novell.com/support/kb/doc.php?id=3312774
http://www.novell.com/support/kb/doc.php?id=3564240

It may be easier to access DomU partitions using “kpatrx”. See the man
pages for more info. Remember you want access to your DomU’s partition
but you don’t want it mounted. Be sure to shutdown your DomU before
attempting to access the disks/partitions from Dom0.

Google found this article on how to shrink an ext3 partition. It is the
most detailed I could find.

http://linuxnextgen.blogspot.ca/2010/10/shrink-ext3-partition-without-losing.html

While I have looked at this procedure and it appears to do what you
want, I have not tested it so you proceed at your own risk. Still, I
hope they are helpful.


Kevin Boyle - Knowledge Partner
If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…