Can't format / delete locked partition from GParted?
772
I can't format my hard disk for Ubuntu installation. It has Fedora installed in it. I wonder how to unlock the locked partition to delete and format it, since I am stuck at installing Ubuntu. I am now using a live CD to do the task. No options are available for me to use.
If it's an LVM partition, you will need to deactivate it using the command lvremove which will remove the lock.
Only then can you delete the partition using gparted.
Use lvscan to view the volume.
Use lvremove to remove it.
Check man pages man lvscan and man lvremove for details.
Open a Terminal on Ubuntu (live cd) and force unmount the partition.
sudo umount -f <name of your partition>
The name of your partition is probably something like /dev/sdb or /dev/sda2. Be careful to type the right file name here. You can use df to find the device file for a mounted partition.
My 'active distro' occupied another drive, I just wanted to get rid of the Fedora LVM - fedora doesn't play nice with other distro's destroyed my 'grub2' list and wouldn't allow any other distro to boot, so needed to 'get rid'
lvscan + lvremove as sudo worked a treat
$ sudo lvscan
ACTIVE '/dev/fedora_localhost/swap' [7.81 GiB] inherit
ACTIVE '/dev/fedora_localhost/home' [407.39 GiB] inherit
ACTIVE '/dev/fedora_localhost/root' [50.00 GiB] inherit
$ sudo lvremove /dev/fedora_localhost/swap
Do you really want to remove and DISCARD active logical volume swap? [y/n]: y
Logical volume "swap" successfully removed
$ sudo lvremove /dev/fedora_localhost/home
Do you really want to remove and DISCARD active logical volume home? [y/n]: y
Logical volume "home" successfully removed
$ sudo lvremove /dev/fedora_localhost/root
Do you really want to remove and DISCARD active logical volume root? [y/n]: y
Logical volume "root" successfully removed
Open the Ubuntu Installer and click "Install Ubuntu", then continue untill you see "Erase disk and install Ubuntu". It will erase the entire disk and use all of it for installation. Ubuntu will automatically partition your disk and proceed with installation. For more information about installing Ubuntu, you can visit this page.
You don't need to format the hard disk before you install Ubuntu, the installer does it automaticaly.
If it's an LVM partition, you will need to deactivate it using the command
lvremove
which will remove the lock.Only then can you delete the partition using gparted.
Use
lvscan
to view the volume.Use
lvremove
to remove it.Check man pages
man lvscan
andman lvremove
for details.Right click on the swap partitions and select swapoff. This will unlock the extended partition and let you resize/move.
Open a Terminal on Ubuntu (live cd) and force unmount the partition.
The name of your partition is probably something like /dev/sdb or /dev/sda2. Be careful to type the right file name here. You can use
df
to find the device file for a mounted partition.My 'active distro' occupied another drive, I just wanted to get rid of the Fedora LVM - fedora doesn't play nice with other distro's destroyed my 'grub2' list and wouldn't allow any other distro to boot, so needed to 'get rid'
lvscan
+lvremove
assudo
worked a treatIssue resolved ... thanks 'geezanansa'
Open the Ubuntu Installer and click "Install Ubuntu", then continue untill you see "Erase disk and install Ubuntu". It will erase the entire disk and use all of it for installation. Ubuntu will automatically partition your disk and proceed with installation. For more information about installing Ubuntu, you can visit this page. You don't need to format the hard disk before you install Ubuntu, the installer does it automaticaly.