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 new to ubuntu and a little confused about how hard drive partitions and LVM works. I remember setting up Ubuntu server 13.04 and telling to to use 1TB of a 3TB server. Well I have maxed that out with blu-ray rips and want the rest of the drive for space.

On log-in it says:

  System load:  2.24                Processes:           179
  Usage of /:   88.7% of 912.89GB   Users logged in:     0
  Memory usage: 6%                  IP address for p5p1: 192.168.0.100
  Swap usage:   0%

  => / is using 88.7% of 912.89GB

lvdisplay outputs:

     --- Logical volume ---
  LV Path                /dev/DeathStar-vg/root
  LV Name                root
  VG Name                DeathStar-vg
  LV Write Access        read/write
  LV Creation host, time DeathStar, 2013-05-18 22:21:11 -0400
  LV Status              available
  # open                 1
  LV Size                2.70 TiB
  Current LE             707789
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

  --- Logical volume ---
  LV Path                /dev/DeathStar-vg/swap_1
  LV Name                swap_1
  VG Name                DeathStar-vg
  LV Write Access        read/write
  LV Creation host, time DeathStar, 2013-05-18 22:21:11 -0400
  LV Status              available
  # open                 2
  LV Size                3.75 GiB
  Current LE             959
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

vgdisplay outputs:

VG Name               DeathStar-vg
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               2.73 TiB
  PE Size               4.00 MiB
  Total PE              715335
  Alloc PE / Size       708748 / 2.70 TiB
  Free  PE / Size       6587 / 25.73 GiB

df outputs:

  Filesystem                     1K-blocks      Used Available Use% Mounted on
  /dev/mapper/DeathStar--vg-root 957238932 848972636  59634696  94% /
  none                                   4         0         4   0% /sys/fs/cgroup
  udev                             1864716         4   1864712   1% /dev
  tmpfs                             374968      1060    373908   1% /run
  none                                5120         4      5116   1% /run/lock
  none                             1874824       148   1874676   1% /run/shm
  none                              102400        24    102376   1% /run/user
  /dev/sda2                         234153     56477    165184  26% /boot

And fdisk /dev/sda -l outputs:

Disk /dev/sda: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

I just don't know what to make of all this and am not sure how I can make it use all 2.73TBs.

Thanks in advance for any help.

EDIT--

Yes I did make changes to the LVM Config, but it didnt do anything.

As requested, output of parted -l /dev/sda

Model: ATA WDC WD30EFRX-68A (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  258MB   256MB   ext2
 3      258MB   3001GB  3000GB                     lvm


Model: ATA WDC WD30EFRX-68A (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/DeathStar--vg-swap_1: 4022MB
Sector size (logical/physical): 512B/4096B
Partition Table: loop

Number  Start  End     Size    File system     Flags
 1      0.00B  4022MB  4022MB  linux-swap(v1)


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/DeathStar--vg-root: 2969GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  2969GB  2969GB  ext4
share|improve this question
    
Please edit your question with the output of sudo vgdisplay and sudo lvdisplay. sudo pvdisplay only shows that you assigned almost the complete "physical HD" to be used by LVM. –  guntbert Jun 23 '13 at 18:39
    
Made changes, thanks for the tip. –  Michael Jun 23 '13 at 18:50
    
Where is the output of sudo pvdisplay? And please don't use fdisk for GPT partition tables - it should have showed you the error that it does not support the GPT format. Instead, provide the output of parted -l /dev/sda. –  gertvdijk Jun 23 '13 at 19:04
1  
guntbert - Yes I did try and make it 2.7 TB, but it didnt grow as you stated. –  Michael Jun 23 '13 at 20:37
1  
It seems you already successfully changed the size of the logical volume. Now you have to change the size of the file system as well. I'd backup all data and then use the resize2fs tool. According to en.positon.org/post/Resize-an-ext3-ext4-partition it should be enough to simply run 'sudo resize2fs /dev/mapper/DeathStar--vg-root'. –  soulsource Jun 23 '13 at 21:24
show 4 more comments

1 Answer

The procedure of increasing the size of a LVM logical volume consists of 2 steps. First one has to increase the size of the logical volume, then one has to extend the filesystem to span the whole logical volume.

The size of the logical volume can be increased using the "lvextend" command. For different filesystems, different commands have to be used to increase their size. In case of ext{2,3,4} it's the "resize2fs" command.

An excellent guide for LVM can be found at the linux documentation project, and it has a page dedicated to extending of a logical volume.

share|improve this answer
add comment

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.