Is there a way to use the Free Space on Parted "Print Free" to extend root partition?
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
[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.
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.
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?
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.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.