LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-10-2017, 10:06 AM   #1
Kenince
LQ Newbie
 
Registered: Apr 2017
Posts: 2

Rep: Reputation: Disabled
Unhappy Is there a way to use the Free Space on Parted "Print Free" to extend root partition?


Hello Experts,

My root partition is running low on space but using parted, I see that I have 10GB of free space on my disk. Is there a way I can use it to extend the root partition?

My setup is as below:

df -h

Code:
[root@srvr-dev ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      6.9G  5.6G  972M  86% /
tmpfs                 127G   46G   81G  36% /dev/shm
/dev/xvda1            243M   75M  156M  33% /boot
/dev/mapper/VolGroup00-LogVol02
                       97M  5.6M   87M   7% /shared_agent_instance_home
/dev/mapper/VolGroup01-LogVol00
                      349G  105G  226G  32% /u01
When I run "fdisk -l" I get...

Code:
[root@srvr-dev ~]# fdisk -l

Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c520c

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          32      256000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2              32        1305    10223616   8e  Linux LVM

Disk /dev/xvdb: 408.0 GB, 408021893120 bytes
255 heads, 63 sectors/track, 49605 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009e5e9

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdb1               1       46200   371093750   83  Linux

Disk /dev/mapper/VolGroup00-LogVol01: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup00-LogVol00: 7516 MB, 7516192768 bytes
255 heads, 63 sectors/track, 913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup01-LogVol00: 380.0 GB, 379995553792 bytes
255 heads, 63 sectors/track, 46198 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup00-LogVol02: 104 MB, 104857600 bytes
255 heads, 63 sectors/track, 12 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
on parted I get...

Code:
[root@srvr-dev ~]# parted
GNU Parted 2.1
Using /dev/mapper/VolGroup00-LogVol02
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) select /dev/xvda
Using /dev/xvda
(parted) print free
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvda: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
        32.3kB  1049kB  1016kB           Free Space
 1      1049kB  263MB   262MB   primary  ext4         boot
 2      263MB   10.7GB  10.5GB  primary               lvm
        10.7GB  21.5GB  10.7GB           Free Space
At the moment I am unable to install any package, the repo fills up the remaining 1GB on the root partition and all my systems hang.

Thanks in advance.
 
Old 04-10-2017, 10:31 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,789
Blog Entries: 13

Rep: Reputation: 4831Reputation: 4831Reputation: 4831Reputation: 4831Reputation: 4831Reputation: 4831Reputation: 4831Reputation: 4831Reputation: 4831Reputation: 4831Reputation: 4831
I would recommend you try gparted which will give you a UI based interface to do this. And yes, unpartitioned space can be added to an existing partition.
 
Old 04-10-2017, 11:29 AM   #3
Kenince
LQ Newbie
 
Registered: Apr 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
Unhappy

@rtmistler,

Thanks for your response.

Unfortunately, I am not in a position to run the g-parted live CD on this server (It's a VM on exalytics). Trying to install gparted as an application failed because I can't install any package on the server before it fills up the root partition.

Is there a way I can do this with fdisk or with parted?
 
Old 04-10-2017, 03:21 PM   #4
crazyhawk
LQ Newbie
 
Registered: Sep 2015
Distribution: openSUSE
Posts: 6

Rep: Reputation: 10
Resizing partitions is possible in general, but I'm not sure if/how it works together with LVM. So just to be sure, you could use the partitioning tool of your choice (I use cfdisk when I can't use gparted, but fdisk or parted should work as well) to create one or more partitions from the free space, and then add them to the LVM you have setup.

I quite like this LVM howto: https://www.howtoforge.com/linux_lvm
 
Old 04-10-2017, 03:24 PM   #5
crazyhawk
LQ Newbie
 
Registered: Sep 2015
Distribution: openSUSE
Posts: 6

Rep: Reputation: 10
Tweaking the system you are running might not be the best idea ever though.. Doesn't exalytics have some admin tools you can access from a web browser or something?
 
Old 04-10-2017, 05:31 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,828

Rep: Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006
This is exactly what LVM was invented for. You need to use LVM commands to see how much space is available in your current environment
Code:
vgs
lvs
This may show you have some unallocated space in the vg you can use immediately. For the free space, you need to create a partition out of that, then make that a (LVM) pv, add that to the VolGroup00, then extend the root lv.
Best guide I know of is the LVM admin guide from Redhat - you may need to consider the RHEL6 version instead, but commands at this level haven't changed.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Extend LVM partition size when there is no free space in the Volume Group LXer Syndicated Linux News 0 06-23-2014 07:00 PM
Minimum recommended free space for root partition gkout Red Hat 5 12-15-2011 08:52 AM
What it the correct amount of free space for the root partition? sirius57 SUSE / openSUSE 3 10-07-2010 10:22 PM
can't see free space after parted resize ianv Linux - General 7 04-22-2005 07:17 AM
Can't free space on root partition AThomsen Fedora 1 06-18-2004 02:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration