LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-22-2018, 03:37 PM   #1
horizn
Member
 
Registered: Jan 2015
Location: UK and Poland
Distribution: Slackware + Debian + Ubuntu
Posts: 170

Rep: Reputation: Disabled
Recover space from LVM


Unfortunately I have installed Proxmox with LVM-Thin option on data volume. Now I realised that I don't want it. However I'd like to recover that space and mount it as a regular non-lvm partition.

Current situation is
Code:
  --- Logical volume ---
  LV Path                /dev/pve/swap
  LV Name                swap
  VG Name                pve
  LV UUID                A7zSAt-fQuR-tQMt-cJfb-i0jk-dKzR-cASVYp
  LV Write Access        read/write
  LV Creation host, time proxmox, 2018-07-14 20:22:25 +0200
  LV Status              available
  # open                 2
  LV Size                8.00 GiB
  Current LE             2048
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0
   
  --- Logical volume ---
  LV Path                /dev/pve/root
  LV Name                root
  VG Name                pve
  LV UUID                JEjwNc-h4kB-aMxH-AS1o-zAEr-c7Ex-LrBKF7
  LV Write Access        read/write
  LV Creation host, time proxmox, 2018-07-14 20:22:25 +0200
  LV Status              available
  # open                 1
  LV Size                96.00 GiB
  Current LE             24576
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1
   
  --- Logical volume ---
  LV Path                /dev/pve/data
  LV Name                data
  VG Name                pve
  LV UUID                Qljnf9-bWp7-Mgb2-Y4dC-HjkO-kBQn-WIb7ZZ
  LV Write Access        read/write
  LV Creation host, time pve, 2018-08-22 22:16:31 +0200
  LV Status              available
  # open                 0
  LV Size                3.12 TiB
  Current LE             817890
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2
I have reduced "data" volume to 1GB, fdisk still can't see that size. Is there any option to regain that space without re-installation?
 
Old 08-22-2018, 04:01 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
An LV is a logical volume. It is part of a VG (Volume Group) which is comprised of 1 or more PVs (Physical Volumes).

fdisk shows physical space on hard drive. You would have used one or more partitions (or entire disk) from one or more hard drives as the PVs in your VG.

Reducing the LV size would free up space in the VG but not in the PV. You'd have to remove a PV from the VG to use it for other purposes. (Before doing that you'd have to be sure none of the other LVs are using extents on the same PV!).

The question is why do you want to do this at all? If you don't need the data LV you can remove it then use lvcreate to make another LV name. The whole point of LVM is to give you more flexibility in adding/remove/resizing than you have with hard drive partitioning.

Run "vgs" to show what VGs you have.
Run "lvs" to show what LVs you have.
Run "pvs" to show what PVs you have.
Give us that output and tell us what you want to create (i.e. What it is you need a device for that makes you think you need space on the hard drive which you likely don't.)
 
Old 08-22-2018, 07:11 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Normally I would agree with Mensawater, but this is an additional wrinkle - especially for a home user.
Quote:
Unfortunately I have installed Proxmox with LVM-Thin option on data volume.
I regularly move partitions around systems, and aligning all the ducks in a row can be a pain with LVM.
Strictly speaking, you don't have to remove an entire pv to get space back for non-LVM use; it can be resized smaller "in-place". But the process is the same - you need to work from the inside->out; shrink the lv, then vg, then pv. The thinpool is another "lv" that needs to be considered as well - interesting it isn't in the display above; the requested commands should show it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with LVM mirror and failed PV, can't recover -- Debian Squeeze lvm 2.02.66-5 Linux Ninja Linux - Server 2 06-02-2017 04:50 PM
Recover deleted LVM? your_shadow03 Linux - Newbie 1 02-26-2010 06:43 AM
HD Failure and LVM, how much can I recover? vaaccess Linux - Hardware 10 01-12-2007 01:12 AM
HD Failure in LVM - What can I recover? vaaccess Linux - General 1 01-05-2007 01:22 PM
How to recover LVM asheesh.tyagi Linux - Newbie 1 05-27-2006 09:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 06:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration