LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Resize disk Suse sp2 (https://www.linuxquestions.org/questions/linux-newbie-8/resize-disk-suse-sp2-4175487578/)

DeWaRs 12-11-2013 03:27 AM

Resize disk Suse sp2
 
Hello everybody,

I'm a real newbie in Linux and I would like to extend my filesytem /dev/sda2 partion. Here is the partition details :


Code:

fdisk -l

Disk /dev/sda: 268.4 GB, 268435456000 bytes
255 heads, 63 sectors/track, 32635 cylinders, total 524288000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000161cf

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              63    4209029    2104483+  82  Linux swap / Solaris
/dev/sda2  *    4209030  207640123  101715547  83  Linux

I would like to add the whole free space of /dev/sda to /dev/sda2

Could anyone help me to do that ??

Thanks a lot.

DeWaRs

JJJCR 12-11-2013 03:39 AM

check out this links:

http://www.howtoforge.com/linux_resi...xt3_partitions

https://access.redhat.com/site/docum...size-part.html

or tell us your distro for a more specific answer.

DeWaRs 12-11-2013 03:45 AM

Thanks for your answer, I will read this. My distro is Suse SP2

I have forget to specifie that I would like to extend this partition "in live"

Regards

Emmanuel

JJJCR 12-11-2013 03:52 AM

check out this link: https://www.suse.com/documentation/s...a/biuz4lz.html

text below from link above.

But you will resize it in a live server, I suggests do a testing before proceeding. Back up, back up, test and verify the back up if it is okay and do what you want. Just to be on the safe side.

Quote:


The lvresize, lvextend, and lvreduce commands are used to resize logical volumes. See the man pages for each of these commands for syntax and options information.

You can also increase the size of a logical volume by using the YaST Partitioner. YaST uses parted(8) to grow the partition.

To extend an LV there must be enough unallocated space available on the VG.

LVs can be extended or shrunk while they are being used, but this may not be true for a file system on them. Extending or shrinking the LV does not automatically modify the size of file systems in the volume. You must use a different command to grow the file system afterwards. For information about resizing file systems, see Section 5.0, Resizing File Systems.

Ensure that you use the right sequence:

If you extend an LV, you must extend the LV before you attempt to grow the file system.

If you shrink an LV, you must shrink the file system before you attempt to shrink the LV.

To extend the size of a logical volume:

Open a terminal console, log in as the root user.

If the logical volume contains file systems that are hosted for a virtual machine (such as a Xen VM), shut down the VM.

Dismount the file systems on the logical volume.

At the terminal console prompt, enter the following command to grow the size of the logical volume:

lvextend -L +size /dev/vgname/lvname
For size, specify the amount of space you want to add to the logical volume, such as 10GB. Replace /dev/vgname/lvname with the Linux path to the logical volume, such as /dev/vg1/v1. For example:

lvextend -L +10GB /dev/vg1/v1
For example, to extend an LV with a (mounted and active) ReiserFS on it by 10GB:

lvextend −L +10G /dev/vgname/lvname
resize_reiserfs −s +10GB −f /dev/vg−name/lv−name
For example, to shrink an LV with a ReiserFS on it by 5GB:

umount /mountpoint−of−LV
resize_reiserfs −s −5GB /dev/vgname/lvname
lvreduce /dev/vgname/lvname
mount /dev/vgname/lvname /mountpoint−of−LV

DeWaRs 12-11-2013 04:19 AM

Hello,

Thanks again for your answer. Regarding the backup, no problem, I'm working on a test environment that I can crash. The problem with the link bellow is it's refer to Logical Volume which I don't use in my case :(

EDIT : I think I should refer to this link : https://www.suse.com/documentation/s...a/biuymaa.html, I guess I need before to extend the partition but I don't know how to do that



Regards

Emmanuel

JJJCR 12-11-2013 04:45 AM

you can check gparted tool, you can install it on a live cd.


All times are GMT -5. The time now is 12:43 PM.