LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   CentOS (https://www.linuxquestions.org/questions/centos-111/)
-   -   Removal of Logical Volumes (https://www.linuxquestions.org/questions/centos-111/removal-of-logical-volumes-4175690734/)

efe373 02-18-2021 06:55 AM

Removal of Logical Volumes
 
Hello everyone,

I got a CentOS 8 computer in my workplace. It has 2 disks, 1 TB HDD and 512 GB SSD. However, these two disks are combined as a logical volume unfortunately... So, I do not have control over my disks. Therefore, I have decided to remove this logical volume, separate these two volumes and use them freely. However, I am very new to Linux systems. How can I do what I wanted? Here is the volumes using lvdisplay command:

Code:

[root@localhost /]# lvdisplay -v /dev/cl
  WARNING: Couldn't find device with uuid lE2U0K-Kcay-KVXJ-Luar-h0e7-PaqS-embgAe.
  WARNING: VG cl is missing PV lE2U0K-Kcay-KVXJ-Luar-h0e7-PaqS-embgAe (last written to /dev/sda1).
  WARNING: Couldn't find all devices for LV cl/home while checking used and assumed devices.
  --- Logical volume ---
  LV Path                /dev/cl/swap
  LV Name                swap
  VG Name                cl
  LV UUID                PpHVit-uTPP-1fdC-5Fxt-DLu3-JneD-3pW1N4
  LV Write Access        read/write
  LV Creation host, time localhost, 2021-01-27 16:04:28 +0300
  LV Status              available
  # open                2
  LV Size                4.00 GiB
  Current LE            1024
  Segments              1
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    8192
  Block device          253:1
 
  --- Logical volume ---
  LV Path                /dev/cl/home
  LV Name                home
  VG Name                cl
  LV UUID                A3XLtf-IV5i-1cE9-223B-5j9I-1k3O-s8272C
  LV Write Access        read/write
  LV Creation host, time localhost, 2021-01-27 16:04:28 +0300
  LV Status              available
  # open                1
  LV Size                <1.30 TiB
  Current LE            340594
  Segments              2
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    8192
  Block device          253:2
 
  --- Logical volume ---
  LV Path                /dev/cl/root
  LV Name                root
  VG Name                cl
  LV UUID                VWr53b-d2QR-5vFz-WY4g-BFOP-RKaR-8HvBll
  LV Write Access        read/write
  LV Creation host, time localhost, 2021-01-27 16:04:33 +0300
  LV Status              available
  # open                1
  LV Size                70.00 GiB
  Current LE            17920
  Segments              1
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    8192
  Block device          253:0


Thanks for support.

Efe

syg00 02-18-2021 06:57 PM

Did you inherit the system in this state, or have you been attempting to "fix" this yourself already ?. If the latter what did you do ?. Let's see this
Code:

lsblk -f
[code] ... [/code] tags maintain layout in output as well as commands.

efe373 02-19-2021 01:48 AM

Quote:

Originally Posted by syg00 (Post 6221927)
Did you inherit the system in this state, or have you been attempting to "fix" this yourself already ?. If the latter what did you do ?. Let's see this
Code:

lsblk -f
[code] ... [/code] tags maintain layout in output as well as commands.

Actually the answer is both. This machine came to me yesterday morning, and I have tried to "fix" it all day. Because I am a beginner I have the courage of ignorance, I tried to format the 1 TB HDD, but as you can guess it is failed due to system file in use. However, this morning I couldn't boot the machine even with the rescue kernel. Also, I have learned that the wrong version of the CentOS is installed. Therefore, I have decided to install the required version of CentOS myself. I also couldn't run the command you mentioned, sorry about that. Thanks for all help.

berndbausch 02-19-2021 04:35 AM

What do you mean by "using disks freely"? What does LVM prevent you from doing? LVM makes your storage space usage very flexible and easy to manage compared to disks or disk partitions.

LVM reports a missing disk (and svg00 is trying to help you addressing this problem). If it were not missing, you would have to check if all filesystems fit one of the disks, perform a pvmove to "free" the other disk from LVM extents, then remove the "free" disk from the volume group with vgreduce. To remove LVM entirely, however, the best solution is to reinstall. Perhaps that is the best solution anyway, given the missing disk.

efe373 02-19-2021 04:50 AM

Quote:

Originally Posted by berndbausch (Post 6222055)
What do you mean by "using disks freely"? What does LVM prevent you from doing? LVM makes your storage space usage very flexible and easy to manage compared to disks or disk partitions.

LVM reports a missing disk (and svg00 is trying to help you addressing this problem). If it were not missing, you would have to check if all filesystems fit one of the disks, perform a pvmove to "free" the other disk from LVM extents, then remove the "free" disk from the volume group with vgreduce. To remove LVM entirely, however, the best solution is to reinstall. Perhaps that is the best solution anyway, given the missing disk.

SSD and HDD are combined together to form LVM. Let's say I want to install a program that should run fast, then I should install it into SSD. But, SSD and HDD are merged as a LVM, how can I specify the installation location as SSD in this case? Doesn't LVM retain me from installing it "freely" to the intended location?

Emerson 02-19-2021 10:10 AM

Program will not run faster from SSD, it may load (start) faster. Because programs do not run from drives, they run from RAM. If you look at computing history - this was the very reason why RAM was invented.

efe373 02-19-2021 11:51 AM

Quote:

Originally Posted by Emerson (Post 6222149)
Program will not run faster from SSD, it may load (start) faster. Because programs do not run from drives, they run from RAM. If you look at computing history - this was the very reason why RAM was invented.

Yes, true.

berndbausch 02-19-2021 01:20 PM

Quote:

Originally Posted by efe373 (Post 6222059)
SSD and HDD are combined together to form LVM. Let's say I want to install a program that should run fast, then I should install it into SSD. But, SSD and HDD are merged as a LVM, how can I specify the installation location as SSD in this case? Doesn't LVM retain me from installing it "freely" to the intended location?

The two disks are "merged" in a volume group, but you can ask LVM to create a logical volume on a specific physical volume (i.e. disk or partition). You can even move an existing logical volume to a different physical volume, for example after adding a new fast disk to the volume group.


All times are GMT -5. The time now is 05:17 PM.