PDA

View Full Version : Resizing Linux partition.



vsurinovich
10-Oct-2012, 18:55
I'm running OES 2 SP3 on SUSE Linux Enterprise Server 10. SUSE has been installed into 10 GB partition and now only 1.3 CB free space left. Symantec Antivirus is running on this partition as well and it required additional 1 GB of space. I still have some upartitoned space on the server. Is there any way to expend Linux partition. Linux partition has ReiserFS.

Thank you.

KBOYLE
10-Oct-2012, 20:44
The SUSE documentation is a good place to begin. :-)

If you go to https://www.suse.com/ and using the search box at the top right of the screen to search for "resize file system" you'll find lots of hits. At the moment, links to many of the SLES10 HTTP references are broken (I've reported it). You can find the information you require from the PDF links. This is what the SLES11 docs say:



5.3 Increasing the Size of a Reiser File System

A ReiserFS file system can be increased in size while mounted or unmounted.


Open a terminal console, then log in as the root user or equivalent.
Increase the size of the file system on the device called /dev/sda2, using one of the following methods:

To extend the file system size to the maximum available size of the device, enter

resize_reiserfs /dev/sda2 When no size is specified, this increases the volume to the full size of the partition.
To extend the file system to a specific size, enter

resize_reiserfs -s size /dev/sda2 Replace size with the desired size in bytes. You can also specify units on the value, such as 50000K (kilobytes), 250M (megabytes), or 2G (gigabytes). Alternatively, you can specify an increase to the current size by prefixing the value with a plus (+) sign. For example, the following command increases the size of the file system on /dev/sda2 by 500 MB:

resize_reiserfs -s +500M /dev/sda2


Wait until the resizing is completed before continuing.
If the file system is not mounted, mount it now.
For example, to mount an ReiserFS file system for device /dev/sda2 at mount point /home, enter

mount -t reiserfs /dev/sda2 /home
Check the effect of the resize on the mounted file system by entering

df -h The Disk Free (df) command shows the total size of the disk, the number of blocks used, and the number of blocks available on the file system. The -h option print sizes in human-readable format, such as 1K, 234M, or 2G.

jmozdzen
11-Oct-2012, 16:04
Hi vsurinovich,

I don't have a SLES10 server at hand and have never had to repartition such a server - but many recent distros offer partition resizing tools, i.e. via a bootable live CD. That should work independently of the Linux version installed on the machine :).

If you're likely to run into such situations more often, I'd recommend to set up LVM - that way, you can expand "partitions" (logical volumes) without rebooting the system, as long as there is enough physical disk space available. And if you're low on that, add another disk or two (online, if your system supports it) and continue. Depending on the file systems used, you might be able to expand those to the new LV size even without having to un-mount them.

Resizing a ReiserFS has been covered by Kevin already.

Regards,
Jens

vsurinovich
12-Oct-2012, 20:42
I need to expand partition: /dev/evms/lvm2/system/root (1GB for just to try)

I ran command:

servername# resize_reiserfs -s +1024M /dev/evms/lvm2/system/root

here is an output:

servername#resize_reiserfs 3.6.19 (2003 www.namesys.com)

/dev/evms/lvm2/system/root is of 2621440 blocks size only with reiserfs of 2621440 blocks
size on it. You are trying to expand reiserfs up to 2883584 blocks size.
You probably forgot to expand your partition size.

jmozdzen
12-Oct-2012, 22:54
Hi vsurinovich,

> servername# resize_reiserfs -s +1024M /dev/evms/lvm2/system/root

so you already are on LVM - so you need to expand the logical volume named /dev/evms/lvm2/system/root.

I haven't had to fiddle with evms yet - isn't there support for managing the EVMS parts within YaST? And I'm sure all that is described in the SLES10 docs (available online, my best guess would be the storage admin guide https://www.suse.com/documentation/sles10/pdfdoc/stor_evms/stor_evms.pdf), have you had a look?

Regards,
Jens

vsurinovich
19-Oct-2012, 21:19
Yes, I did look Storage Admin Guide. I'll write a little bit more information about my server and maybe someone can give me an advise. The server has three 450 GB SAS HDs (RAID5).Wnen I installed SUSE the OS assigned default value 14.9 GB for physical volume. I could not encrease this size during installation and I decided to that later. Then I installed OES2 on top, alocated about 600 GB for NSS volumes. Now I have over 200 GB unpartitioned space and I'd like to encrease default system volume. I tried to use both tools LVM and Partitioner, but neither one allowed me to resize system volume.

Vlad.

KBOYLE
19-Oct-2012, 23:13
vsurinovich wrote:

>
> Yes, I did look Storage Admin Guide. I'll write a little bit more
> information about my server and maybe someone can give me an advise.
> The server has three 450 GB SAS HDs (RAID5).Wnen I installed SUSE the
> OS assigned default value 14.9 GB for physical volume. I could not
> encrease this size during installation and I decided to that later.
> Then I installed OES2 on top, alocated about 600 GB for NSS volumes.
> Now I have over 200 GB unpartitioned space and I'd like to encrease
> default system volume. I tried to use both tools LVM and Partitioner,
> but neither one allowed me to resize system volume.
>
> Vlad.

Hi Vlad,

You can't expand the file system if it already uses all the avail space
on the partition (or logical volume). First, you have to make more
space available in your Logical Volume by expanding the LV, *then*
expand the file system.

Before you can expand your logical volume, you must have free space in
your Volume Group. If you do not have enough free space in the Volume
Group, you can add another physical volume to create additional free
space.

You said:

> SUSE has been installed into 10 GB partition and now only 1.3 CB free
> space left.

and:

> I need to expand partition: /dev/evms/lvm2/system/root (1GB for just
> to try)

Since root is a logical volume, /boot must be a separate partition, is
that correct? And swap too? If so, then that is three partitions you
have used out a maximum of four primary partitions.


You also said:

> Wnen I installed SUSE the OS assigned default value 14.9 GB for
> physical volume.

and:

> Now I have over 200 GB unpartitioned space and I'd like to encrease
> default system volume.


When you say "unpartitioned space", that implies it is on an existing
disk. Is it? Or have you used your RAID management software to create
multiple Logical Volumes (LUNs) and that 200+ GB is still unallocated
space on the RAID array? I'm trying to understand just where that 200+
GB of free space is hiding before suggesting how to use it to expand
your root LVM.

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

vsurinovich
24-Oct-2012, 18:25
Hi Kevin,

I wish I can paste a screen shot of my SUSE server desktop in the forum's interface, but I think it's not an option.

Now, I'm using YasT LVM.

I have three devices:

/dev/mapper/sda3.1 599.9 GB
/dev/sda1 70.5 MB Linux native
/dev/sda2 14.9 GB Linux LVM

sda2 belongs to Volume group "system" (I need to expand it).
sda1 and sda3.1 did not belong to any volume group (blank).

Physical volume size: 14.9

I pressed "Add Volume" and physical volume size changed to 614.9 GB and device /dev/mapper/sda3.1 599.9 GB was added to Volume Group: system.

This is production server that's why I did not apply changes yet. I want to make sure I can remove /dev/mapper/sda3.1 from Volume Group: system (if needed).

Seem like I can edit (increase logical volume group root up to max. size 612.9 GB) now.

I'm planing to add 100 GB to Volume: root. Is it right way to do that?

Vlad.

KBOYLE
25-Oct-2012, 02:11
vsurinovich wrote:

>
> Hi Kevin,
>
> I wish I can paste a screen shot of my SUSE server desktop in the
> forum's interface, but I think it's not an option.
>
> Now, I'm using YasT LVM.
>
> I have three devices:
>
> /dev/mapper/sda3.1 599.9 GB
> /dev/sda1 70.5 MB Linux native
> /dev/sda2 14.9 GB Linux LVM
>
> sda2 belongs to Volume group "system" (I need to expand it).
> sda1 and sda3.1 did not belong to any volume group (blank).
>
> Physical volume size: 14.9
>
> I pressed "Add Volume" and physical volume size changed to 614.9 GB
> and device /dev/mapper/sda3.1 599.9 GB was added to Volume Group:
> system.
That is correct. You have to "Add Volume" to create additional free
space in the Volume Group.


> This is production server that's why I did not apply changes yet. I
> want to make sure I can remove /dev/mapper/sda3.1 from Volume Group:
> system (if needed).
You can only remove a device if it is not being used. Once you increase
the size of an existing LV and you need to use some of the free space
on this additional device, you will not be able to remove it.


> Seem like I can edit (increase logical volume group root up to max.
> size 612.9 GB) now.
You can increase the size of an existing LV or create new LV's as long
as there is free space in the Volume Group. You can increase an
existing LV to use all the free space if that is what you want.


> I'm planing to add 100 GB to Volume: root. Is it right way to do that?
That is one way to do it and probably the easiest. Another option would
be to create one or more new LV's for /var, /home, or /opt, wherever
you see growth.

If the size of the root (/) is growing you should try to find out which
directories are growing. /var/log is where the log files are kept so it
will increase in size. /home is where user files are usually kept.

For example, if your /home directory is growing and you want to make
sure it doesn't use up all the free space in your root directory,
create a new LV, move everything from /home to the new LV, then mount
the new LV at /home.

How you manage growth and your free space depends on how your server is
used. There is no one correct way to do it.

> Vlad.



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