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 need help on resize two LVM partitions as I'm afraid of loosing data.

I'm using Ubuntu Server 12.04 headless mode.

LVS:

root@server:/# lvs
  LV      VG   Attr   LSize   Origin Snap%  Move Log Copy%  Convert
  home    LVG  -wi-ao  27,94g
  root    LVG  -wi-ao   6,52g
  storage LVG  -wi-ao 504,84g
  swap    LVG  -wi-ao 732,00m

FDISK:

root@server:/# fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 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: 0x00067ea1

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      585727      291840   83  Linux
/dev/sda2          587774   156301311    77856769    5  Extended
/dev/sda5          587776   156301311    77856768   8e  Linux LVM

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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: 0x0008c066

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   976771071   488384512   8e  Linux LVM

Disk /dev/mapper/LVG-root: 6996 MB, 6996099072 bytes
255 heads, 63 sectors/track, 850 cylinders, total 13664256 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/LVG-root doesn't contain a valid partition table

Disk /dev/mapper/LVG-swap: 767 MB, 767557632 bytes
255 heads, 63 sectors/track, 93 cylinders, total 1499136 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/LVG-swap doesn't contain a valid partition table

Disk /dev/mapper/LVG-home: 30.0 GB, 29997662208 bytes
255 heads, 63 sectors/track, 3647 cylinders, total 58589184 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/LVG-home doesn't contain a valid partition table

Disk /dev/mapper/LVG-storage: 542.1 GB, 542063460352 bytes
255 heads, 63 sectors/track, 65902 cylinders, total 1058717696 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/LVG-storage doesn't contain a valid partition table

I want to shrink my /home LV partition and extent my /storage LV partition.

What is the proper method to do this?

Thanks

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You have to use vgreduce on the home device and vgextend on the storage device. After that youhave to use resize2fs on both to resize the file system, if not, it will no show the changes.

share|improve this answer

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.