Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am quite new to LVM and I'm uncertain about what is happening here. I was not the one to initially setup this machine.

There is a harddrive of 1tb in size and an LVM partition of only 50gb in size. I can not figure out how I can use the remaining space of the harddrive.

output of command df -h:

Filesystem              Size  Used Avail Use% Mounted on
/dev/mapper/vg00-slash   46G  1.4G   42G   4% /
udev                    3.9G  4.0K  3.9G   1% /dev
tmpfs                   1.6G  236K  1.6G   1% /run
none                    5.0M     0  5.0M   0% /run/lock
none                    3.9G     0  3.9G   0% /run/shm
/dev/sda1               232M   29M  191M  14% /boot

output of command fdisk -l:

Disk /dev/sda: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders, total 2147483648 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: 0x00038096

   Device Boot      Start         End      Blocks   Id  System
 /dev/sda1   *        2048      499711      248832   83  Linux
 /dev/sda2          501758   104855551    52176897    5  Extended
 /dev/sda5          501760   104855551    52176896   8e  Linux LVM

Disk /dev/mapper/vg00-swap: 3997 MB, 3997171712 bytes
255 heads, 63 sectors/track, 485 cylinders, total 7806976 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: 0x00000000

Disk /dev/mapper/vg00-swap doesn't contain a valid partition table

Disk /dev/mapper/vg00-slash: 49.4 GB, 49429872640 bytes
255 heads, 63 sectors/track, 6009 cylinders, total 96542720 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: 0x00000000

Disk /dev/mapper/vg00-slash doesn't contain a valid partition table

What I assume I had to do, was create a new partition on /dev/sda to contain the remaining space but when trying to create a new primary partition I am told I can't.

Last sector, +sectors or +size{K,M,G} (499712-501757, default 501757): +800G
Value out of range.

I do not know what I can do now...


When trying to resize the logical volume I get:

# lvresize vg00/slash -L +800g
Extending logical volume slash to 846.04 GiB
Insufficient free space: 204800 extents needed, but only 0 available

# pvdisplay -m
--- Physical volume ---
PV Name               /dev/sda5
VG Name               vg00
PV Size               49.76 GiB / not usable 2.00 MiB
Allocatable           yes (but full)
PE Size               4.00 MiB
Total PE              12738
Free PE               0
Allocated PE          12738
PV UUID               WNZba3-bCCs-NmqL-Bc9v-zusy-TtfQ-BpAj3e

--- Physical Segments ---
Physical extent 0 to 952:
  Logical volume      /dev/vg00/swap
  Logical extents     0 to 952
Physical extent 953 to 12737:
  Logical volume      /dev/vg00/slash
  Logical extents     0 to 11784

(parted) print free                                                       
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 1100GB
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  256MB   255MB   primary   ext4         boot
        256MB   257MB   1048kB            Free Space
 2      257MB   53.7GB  53.4GB  extended
 5      257MB   53.7GB  53.4GB  logical                lvm
        53.7GB  1100GB  1046GB            Free Space
share|improve this question

2 Answers 2

up vote 1 down vote accepted

It looks like you're trying to add a new primary partition in-between your current /dev/sda1 and /dev/sda2. (Evidence: fdisk is saying that the acceptable ranges of end points are 499712-501757, default 501757, which is between those two partitions.) There simply isn't enough space there to do that. Instead, tell fdisk to begin the partition at 104855552 (or later) and give it the default end value (unless you want to save some space for some other purpose). This should give you a partition that uses the rest of the available disk space, minus a bit of wastage near the beginning.

Alternatively, you could use cfdisk, GParted, or some other tool that provides a more visual approach to partitioning, which will make such an error less likely.

share|improve this answer

Most of the disk is in an LVM partition already, which lvm calls a physical volume. LVM then divides up the space from physical volumes into logical volumes. You can use the pvs or pvdisplay commands to show stats on the physical volumes and lvs or lvdisplay to see information on all of the logical volumes. You should see that there is plenty of free space in the physical volume. You then can use lvresize to expand a logical volume to use more of the space, as in:

sudo lvresize vg00/slash -L +10g

That will add 10 gb to the logical volume named slash in the volume group vg00, which is apparently your root volume. After that, you need to expand the filesystem to use that space, which assuming you are using the default ext4 filesystem with:

sudo resize2fs /dev/mapper/vg0-slash
share|improve this answer
    
I've tried to resize the logical volume but was told there are no extents available. I've edited my question with the output of the command. –  Alex Dow Jul 17 at 14:53
    
@v0idnull, based on your new information, your lvm partition is full but has plenty of unpartitioned space after it, so you just need to resize it to include that space, then you can grow or create more logical volumes. You can do this using gparted, or the parted resize command. If you go the parted route you will need to run pvresize on the partition after to tell lvm about the new space. –  psusi Jul 18 at 14:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.