How to unlock partition in Gparted? [duplicate]

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?

enter image description hereenter image description here


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:

  1. Boot the live system.
  2. Mount the LVM volume.
  3. Resize the contained file system.
  4. Unmount the volume.
  5. Resize the volume.
  6. Resize the volume container.
  7. Resize the volume container partition.
  8. 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.

www.hdtta.co.uk/ios7/gparted.png

www.hdtta.co.uk/ios7/udisk.png