Removal of Logical Volumes

Issues related to applications and software problems and general support
Post Reply
efe373
Posts: 3
Joined: 2021/02/18 12:47:54

Removal of Logical Volumes

Post by efe373 » 2021/02/18 12:51:28

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 (I think) 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:
[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
Last edited by efe373 on 2021/02/18 13:51:37, edited 1 time in total.

User avatar
TrevorH
Forum Moderator
Posts: 30344
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Removal of Logical Volumes

Post by TrevorH » 2021/02/18 13:17:24

According to that, you've already removed one of the physical volumes from the volume group and have this lost access to your /home filesystem. If you still have the disk present with all its data on it then put it back. If you don't then all your /home along with all its data is lost.

How you proceed with this once you have put that disk back depends on how things are set up. Please post the output from the following commands, all except df require to be run as root.

pvs
vgs
lvs
df -mT
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

efe373
Posts: 3
Joined: 2021/02/18 12:47:54

Re: Removal of Logical Volumes

Post by efe373 » 2021/02/18 13:36:16

TrevorH wrote:
2021/02/18 13:17:24
According to that, you've already removed one of the physical volumes from the volume group and have this lost access to your /home filesystem. If you still have the disk present with all its data on it then put it back. If you don't then all your /home along with all its data is lost.

How you proceed with this once you have put that disk back depends on how things are set up. Please post the output from the following commands, all except df require to be run as root.

pvs
vgs
lvs
df -mT
Edit: Oh I see now. I think you are mentioning the HDD when you say I have removed one of the physical volumes. I have tried to format it and played with it actually, with the confidence of no data on it (but there is something in it related to OS I think). I have tried to change its type to ext4 and I did something else which I do not remember. What I have done causes new problems now? If that is the case, I will feel sorry...

Hi Trevor, thanks for your reply. The machine came to me today and I do not have any data on it. Just a second before I have removed swap part using lmremove. However, I couldn't remove the other two partitions, because of filesystem in use it said.

I have run the commands that you given to me. I also run the last command as root, I hope that is not a problem. (I have written X's because there was a name of my colleague at that location.) Here are the logs:
[root@localhost /]# pvs
[root@localhost /]# vgs
[root@localhost /]# lvs
[root@localhost /]# df -mT
Filesystem Type 1M-blocks Used Available Use% Mounted on
devtmpfs devtmpfs 64162 0 64162 0% /dev
tmpfs tmpfs 64193 0 64193 0% /dev/shm
tmpfs tmpfs 64193 11 64182 1% /run
tmpfs tmpfs 64193 0 64193 0% /sys/fs/cgroup
/dev/mapper/cl-root xfs 71645 5722 65924 8% /
/dev/nvme0n1p4 xfs 1014 238 777 24% /boot
/dev/nvme0n1p1 vfat 508 65 444 13% /boot/efi
/dev/mapper/cl-home xfs 1361711 9703 1352008 1% /home
tmpfs tmpfs 12839 2 12838 1% /run/user/42
tmpfs tmpfs 12839 8 12831 1% /run/user/1000
/dev/nvme0n1p3 vfat 1532 906 627 60% /run/media/XXXXX/DOCVIEW
/dev/nvme0n1p2 vfat 1020 133 888 14% /run/media/XXXXX/HPDOCS
I just want to have two separate partitions, one is my 1 TB HDD, the other is 512 GB SSD. Then, I want the CentOS to be in SSD (maybe SSD can be partitioned to two, and two separate home folders) and I want to use my HDD as a mass storage.

Edit2: I have run the lvmdiskscan command also, I am not sure it is useful but here are the logs:
[root@localhost /]# lvmdiskscan
/dev/nvme0n1 [ <476.94 GiB]
/dev/nvme0n1p1 [ 512.00 MiB]
/dev/sda1 [ 931.51 GiB]
/dev/nvme0n1p2 [ 1.00 GiB]
/dev/nvme0n1p3 [ 1.50 GiB]
/dev/nvme0n1p4 [ 1.00 GiB]
/dev/nvme0n1p5 [ <465.49 GiB]
/dev/nvme0n1p6 [ 7.45 GiB]
/dev/sdb1 [ 14.84 GiB]
0 disks
9 partitions
0 LVM physical volume whole disks
0 LVM physical volumes

efe373
Posts: 3
Joined: 2021/02/18 12:47:54

Re: Removal of Logical Volumes

Post by efe373 » 2021/02/19 08:59:01

It turns out the version of the installed CentOS is not suitable for the job I will perform. So that, I have decided to install an older version of the CentOS by myself. Thanks for all help.

Post Reply

Return to “CentOS 8 - General Support”