0

I just bought a new computer with an HDD + SSD. I must've accidentally encrypted the HDD it during installation, although I am sure I did undo it, but here it is, encrypted and even if I put the password it will display the error:

An error occurred while accessing '930.3 GiB Encrypted Drive', the system responded: An unspecified error has occurred: No such interface 'org.freedesktop.UDisks2.Filesystem' on object at path /org/freedesktop/UDisks2/block_devices/dm_2d3

So I want to remove it. It has nothing in it, since it is a brand new computer, and it was when I found out about lvremove and lvscan, but lvscan shows me the following:

root@gabriel:/home/gabriel# lvscan
  ACTIVE            '/dev/kubuntu-vg/root' [117.04 GiB] inherit
  ACTIVE            '/dev/kubuntu-vg/swap_1' [976.00 MiB] inherit
  inactive          '/dev/kubuntu-vg/root' [<929.34 GiB] inherit
  inactive          '/dev/kubuntu-vg/swap_1' [976.00 MiB] inherit

df

root@gabriel:/home/gabriel# df
Filesystem                   1K-blocks    Used Available Use% Mounted on
udev                           3999308       0   3999308   0% /dev
tmpfs                           806208    1664    804544   1% /run
/dev/mapper/kubuntu--vg-root 120276728 8690824 105433100   8% /
tmpfs                          4031032   65164   3965868   2% /dev/shm
tmpfs                             5120       4      5116   1% /run/lock
tmpfs                          4031032       0   4031032   0% /sys/fs/cgroup
/dev/sdb2                       721392  150632    518296  23% /boot
/dev/sda1                       523248    6228    517020   2% /boot/efi
tmpfs                           806204       0    806204   0% /run/user/119
tmpfs                           806204      12    806192   1% /run/user/1000

gparted

enter image description here

I tried lvremove /dev/sda(1):

root@gabriel:/home/gabriel# lvremove /dev/sda(1)
  Volume group "sda(1)" not found
  Cannot process volume group sda(1)

the (1) means I tried with "sda" and "sda1". I also attempted with 3, but same message.

I am supposing the volume group would be the /dev/kubuntu-vg/root|swap_1, but they are duplicated. How do I remove the logical volume of my HDD?

  • Are you trying to delete your root partition while running the system that is installed on it? AFAIK you cannot delete it that way. Use a live CD and reformat (or do a plain reinstall since it is just brand new) – Fiximan Oct 27 '18 at 13:14
  • Well, I do not know why there is a boot partition in the HDD. That is supposed to be just for storage, like an external HDD, but in the computer. Do I still need to use live CD? – gamofe Oct 27 '18 at 13:15
  • My system is installed in my SSD, and what I want to remove is the HDD's. – gamofe Oct 27 '18 at 13:17
  • Sorry missed that you had an active root on the SSD and the rest on the HDD. Did you try using cfdisk for repartitioning, yet? I assume the HDD can be wiped without concern. – Fiximan Oct 27 '18 at 13:18
  • 1
    for lvm namespace clashes, you have to rename by VG UUID, e.g. unix.stackexchange.com/a/324414/30851 – frostschutz Oct 27 '18 at 13:44
2

Neither /dev/sda1 nor /dev/sda3 are logical volumes. /dev/sda3 contains a volume group (kubuntu-vg), which in turn contains the logical volumes (root, swap_1, maybe more, maybe less).

You can show the logical volumes with lvdisplay or shorter and clearer lvs. Same with volume groups, vgdisplay or vgs.


To remove a logical volume with lvremove, you must give the complete path as shown in the example section

lvremove kubuntu-vg/root

or to remove all logical volumes in this group

lvremove kubuntu-vg

If the logical volumes are still active, you must deactivate them first

vgchange --activate n kubuntu-vg/root

or use the force when removing

lvremove --force kubuntu-vg/root

If there are really two volume groups with the same name, or two logical volumes with the same name, you may need to use the UUID as @frostschutz suggested in comments. This may be shown with lvdisplay or, a bit more compact, with

lvdisplay | grep -e Path -e UUID
  • Very interesting. Too bad I did something wrong with cfdisk, even having the HDD selected, that affected my SSD and I had to wipe out clean everything in my SDD and make a clean install. Thank you for your answer, I will still select as the correct one because it looks like it is. – gamofe Oct 27 '18 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.