How to unlock partition in Gparted?
Solution 1
If partitions are showed with a lock in gparted, then they are mounted. Usually GPartEd is able to unmount them, but sometimes this isn't possible, so you have to manually unmount them with the following commands as root:
- umount /dev/sda1
- umount /dev/sda5
If you aren't logged in as root (root normally has '#' at the end of the command prompt whereas a normal user usually has '$'). You need to add sudo
in front of the commands.
In case of the screenshots however, at least /dev/sda1 is mounted in a way it can't be unmounted as it is necessary for the currently running system to work.
One way you can avoid the drives being mounted ("locked") in the first place, is using a liveCD like PartedMagic (http://www.partedmagic.com). This one really shouldn't mount any of your partitions if you don't manually say so.
Solution 2
GParted doesn't support managing partitions inside LVM volumes. You will have to do this by hand:
- Boot the live system.
- Mount the LVM volume.
- Resize the contained file system.
- Unmount the volume.
- Resize the volume.
- Resize the volume container.
- Resize the volume container partition.
- Reboot.
These are the general steps to take. The specifics depend on the file system and I don't know the LVM commands by heart. Please consult the relevant manual pages and open another question specific to this topic, if you run into problems.
Edit: This is the reason LVM isn't part of the default Ubuntu setup.
Solution 3
Disks (gnome-disks) which uses Udisk is a very simple and capable utility. It allowed me to have 2 bootable Linux partitions and to mount a previous broken file system. That way I could extract all my data and settings.
Although Udisk doesn't replace Gparted, it has some useful features. Setting partition labels, mount points and automount is simple in the rather too basic graphic interface.
It also allowed me to unmount partitions which Gparted wouldn't. (The main reason for this answer)
Couple of pics to illustrate my setup. sdb1 & sbd6 are bootable from grub, and sdb7 is the damaged partition.
Related videos on Youtube
Shelly
Updated on September 18, 2022Comments
-
Shelly over 1 year
Im new in using Ubuntu and I cant seem to make any partitions for a new dual boot OS and the swap file or for any other matter i would want to use the partition because the drive is locked.
I have already tried running the Live CD or in my case a Live USB and then ran Gparted but the status is still the same. Could anyone please shed some light in this matter?
-
Mitch about 11 yearsWhat is you total drive capacity?
-
Shelly about 11 years160 GB. Thanks for the reply and edits. : )
-
-
Shelly about 11 yearsHello @FSMaxB, i would give you a +1 but my current reputation wont allow me to. I will give this a try. I am concerned however if I unmount this while running Ubuntu (ie. unmount dev sda5 using currently running Ubuntu and not the LiveCD), will give back any errors or is that even possible?
-
Shelly about 11 yearsI did try the
sudo umount /dev/sda5
and it returned umount: /dev/sda5: not mounted but when checking in gparted it is still locked. Any insights on what I am doing wrong? -
FSMaxB about 11 yearsYou can't unmount the partition where ubuntu is running on. If you want to change anything to partition where the system is installed, there is no other way than using a liveCD. As to /dev/sda5: This seems to be something with lvm (logical volume manager), but I don't really know what lvm is. This should, however, not be mounted when using a liveCD.
-
FSMaxB about 11 yearsWhich liveCD did you run. Parted Magic? And yes, try the commands from the LiveCD as well. If this doesn't work, I can't help you, but you could add the "lvm" tag to your question, so you have a greater chance that someone knowing something about lvm reads your question.
-
Shelly about 11 yearsThanks for the suggestions. I will try this out and let you know.
-
Shelly about 11 yearsThe LiveCD and PartedMagic both dont seem to work. Parted magic allows me to deactivate the drive but will not let it partition it. I have tried the umount command usin terminal thru partedmagic and ubuntu livecd as well
-
FSMaxB about 11 yearsThen maybe another one can solve your problem. I have no further suggestions on what to do.
-
David Foerster over 10 yearsThis won't work, because
/dev/sda5
contains a LVM container. Please have a look at my answer. -
FSMaxB over 10 years@DavidFoerster You have to keep in mind that this question was asked more than five months ago, so probably it isn't relevan't to the person asking anymore, so don't think it's going to get accepted. However this is still relevant to others having the same problem!
-
David Foerster over 6 yearsHow does that help with LVM volumes? -1