Use the free space from pve-root under pve-data ?

fpausp

Renowned Member
Aug 31, 2010
633
42
93
Austria near Vienna
You can see there is no space left on /dev/mapper/pve-data, is it possible to use the free space from /dev/mapper/pve-root ?


Code:
root@proxmox:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/pve-root   95G  1.6G   89G   2% /
tmpfs                 7.9G     0  7.9G   0% /lib/init/rw
udev                  7.9G  228K  7.9G   1% /dev
tmpfs                 7.9G   19M  7.9G   1% /dev/shm
/dev/mapper/pve-data  333G  333G     0 100% /var/lib/vz
/dev/sda1             495M   70M  400M  15% /boot
/dev/fuse              30M   16K   30M   1% /etc/pve
 
yes

1. backup the machine
2. start it from a linux cd (systemrescuecd, grml etc.)
3. check the filesystem on /dev/mapper/pve-root (e2fsck)
4. resize the filesystem on /dev/mapper/pve-root (resize2fs)
5. reduce the logical volume /dev/mapper/pve-root (lvreduce)
6. extend the logical volume /dev/mapper/pve-data (lvextend)
7. resize the filesystem on /dev/mapper/pve-data (resize2fs)
 
Ooops, that sounds very dangerus and longsome, are you shure that this is working with my harwareraid 1 config ?

I used the baremetal installer is that partitioning sheme normal (/dev/mapper/pve-root 95G), why is it so big ?
 
Hi, thank you for your comments.

I think I will backup my vm´s and reinstall the server and use the bootoption "linux maxroot=12" because I dont like to much downtime ...

thanks again
fpausp
 
The down time you will have is only when you are shrinking /dev/mapper/pve-root. Extending /dev/mapper/pve-data can be done while it is online and mounted.
 
Hi,
IMHO GParted can't resize lvm-partitions, or changed that in the last year?

Udo
For production environments I would also recommend the command line tools from the lvm2-tools package since these tools are developed by the same group of persons which develop and maintain LVM. GUI tools will always come short in the long run so people doing serious system administration on *nix might as well learn to master the command line today and not the day when the command line is the only option. Just my 2 cents but worth every penny:)
 
yes

1. backup the machine
2. start it from a linux cd (systemrescuecd, grml etc.)
3. check the filesystem on /dev/mapper/pve-root (e2fsck)
4. resize the filesystem on /dev/mapper/pve-root (resize2fs)
5. reduce the logical volume /dev/mapper/pve-root (lvreduce)
6. extend the logical volume /dev/mapper/pve-data (lvextend)
7. resize the filesystem on /dev/mapper/pve-data (resize2fs)

I can confirm that this worked ok.

Here are the steps I did:

  1. Boot from grml
  2. Activated the lvm with: lvm vgchange -a y
  3. checked the filesystem with:
    1. e2fsck -f /dev/mapper/pve-root
    2. e2fsck -f /dev/mapper/pve-data
  4. resize the filesystem on pve-root. My pve-root was about 27Gb and shrinked it to 14Gb:
    1. resize2fs -f /dev/mapper/pve-root 14G
  5. reduce the logical volume on pve-root:
    1. lvm lvreduce -L14G /dev/mapper/pve-root
  6. extend the logical volume on pve-data:
    1. lvextend -l +100%FREE /dev/mapper/pve-data
  7. esize the filesystem on pve-data:
    1. resize2fs /dev/mapper/pve-data
  8. reboot
Other link refs (add https to all - I'm new and I can't post urls):
  • forum.proxmox.com/threads/resizing-root-partition-and-giving-proxmox-more-space.18048/
  • gist.github.com/dergachev/6828967
  • access.redhat.com/solutions/44089
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!