3

I had Ubuntu 12.10 to replace Easy-Peasy, however some packages broke and the screen would come up blank after booting/BIOS, I installed a dual boot of Ubuntu 12.10 which works and switched to the KDE desktop environment and have recovered all files. I want to delete the non working version from the boot menu, and can't find out how, can you help me?

I had it dual booting windows 7 starter and Easy-Peasy, I then deleted Win7 so Easy Peasy was my only OS - I switch Os(s) like most people change clothes sometimes, HOWEVER, I really Like the new setup and just wish I could use all of my HDD.

I replaced Easy Peasy with the Upgrade on Ubuntu 12.10, but some packages were broken causing the graphics to fail, so I now have a broken copy of Ubuntu in my boot menu, and a working copy with both Gnome and KDE installed which I can switch in the login screen, what I want is to delete the non-working version to free up the space on the hard-drive for the working version.

unveiledcorgi64@unveiledcorgi64-LT40:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       146G   21G  118G  16% /
udev            992M   12K  992M   1% /dev
tmpfs           402M  900K  401M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none           1003M  1.9M 1001M   1% /run/shm
none            100M   24K  100M   1% /run/user
/dev/sda6       146G  2.8G  136G   3% /media/5f926dfe-f3b6-4ca6-a4ef-c559a888a773

unveiledcorgi64@unveiledcorgi64-LT40:~$ mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
gvfsd-fuse on /run/user/unveiledcorgi64/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=unveiledcorgi64)
/dev/sda6 on /media/5f926dfe-f3b6-4ca6-a4ef-c559a888a773 type ext4 (rw,nosuid,nodev,uhelper=udisks)

unveiledcorgi64@unveiledcorgi64-LT40:~$ sudo parted -l
[sudo] password for unveiledcorgi64: 
Model: ATA WDC WD3200BPVT-2 (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number  Start   End    Size    Type      File system     Flags
 1      1049kB  159GB  159GB   primary   ext4            boot
 2      159GB   320GB  162GB   extended
 6      159GB   317GB  159GB   logical   ext4
 5      317GB   320GB  3042MB  logical   linux-swap(v1)

unveiledcorgi64@unveiledcorgi64-LT40:~$ swapon -s
Filename                                Type            Size    Used    Priority
/dev/sda5                               partition       2970620 5248    -1
Eliah Kagan
  • 117,780

2 Answers2

2

Your installed Ubuntu/Kubuntu system resides in /dev/sda1. That is to say that its root partition (/) is on /dev/sda1, and you don't have separate /boot, /home, or other partitions for that system.

It does use the swap partition from the old EasyPeasy system.

To get rid of the old EasyPeasy system:

  • Make sure there really are no valuable data in it. If you're sure none of your documents or other important files remain there (without being offloaded elsewhere), proceed.

  • Make sure all your documents and important files in the [K]Ubuntu system are backed up. Besides that you should have a backup of all important files (that wouldn't be easily replaceable) anyway, dynamic partition resizing carries a risk of data loss. There are two reasons for this--problems sometimes occur and are occasionally not fully recoverable, and you might yourself make a mistake during the process.

  • Boot from an Ubuntu live CD/DVD or USB flash drive. If you don't have one; create one. (This is the same thing you used to install Ubuntu.) It is not safe to edit a physical disk's partition table from a utility running in an OS installation that resides on the same physical disk.

  • Select Try Ubuntu without installing (not Install Ubuntu).

  • When a usable desktop comes up, run the GParted Partition Editor. To do this, press the Super key (also called the Windows key) or click the "dash home" icon on the upper left of the screen. Startityping gparted into the text box. When you see GParted come up, click it.

    Alternatively, if this is a Kubuntu live environment, you'll find GParted in your menus, or you can use the Run... dialog box to run kdesudo gparted.

  • I will refer to /dev/sda5 and /dev/sda6 (as well as other partitions) in the following instructions. However, the following instructions are only correct as written if /dev/sda5 is much smaller than /dev/sda6. If /dev/sda5 is instead much larger than /dev/sda6, then assuming they are both still contained within the extended partition (see below), in that that situation (and that situation only) you should take every instance of /dev/sda5 to mean /dev/sda6 and every instance of /dev/sda6 to mean /dev/sda5.

    (Somewhat annoyingly, occasionally partitions are numbered differently from the perspective of different systems. I don't believe that's the case here, but if it is, I don't want to have you accidentally remove the swap partition. That would not cause data loss, but it would require extra work to be done to fix it.)

    Because of that possible complication--but even without it, assuming you are not already familiar/comfortable with dynamic partition resizing (in which case you would probably not have asked how to do this)--I recommend reading these instructions all the way through before starting to follow them.

  • In GParted, you'll see the /dev/sda1 partition at the left side of the horizontal bar representing all the partitions on the drive. To the right of that you'll see an extended partition, which is a kind of container for other partitions. The extended partition here is called /dev/sda2. Inside the extended partition is your swap partition, /dev/sda5 (on the right side), and /dev/sda6 (to the left of it). Unless they are switched, as described above. /dev/sda6 is the only partition you want to delete--it is the partition for the old EasyPeasy system. It is much larger than /dev/sda5.

  • Delete /dev/sda6 in GParted. Now shrink /dev/sda2 (the extended partition container) by clicking Resize/Move and dragging its left side as far to the right as possible, so it's just big enough to contain /dev/sda5 (the swap partition). When you do this, the value of free space preceding will increase (and free space following will remain the same).

  • By removing /dev/sda6 (the partition for the old EasyPeasy system) and shrinking down /dev/sda2, you created free space to the right of /dev/sda1. You probably recall /dev/sda1 as the partition that stores all the files associated with your new [K]Ubuntu system.

    So now, using Resize/Move on /dev/sda1, expand /dev/sda1 to the right, causing a decrease in free space following. Drag its right border as far to the right as you can, so that it is as close as possible to the left border of /dev/sda2,the extended partition. Don't worry if a small amount of unpartitioned space remains between them. (That is, drag it as far as you can, but it's fine if GParted will not let you expand it all the way.)

  • Apply your changes by clicking the green check mark in GParted.

  • If there were errors, you should be able to access the Internet from the live CD/DVD/USB system and provide information about them. (However, there will of course be no guarantee that I will be available to tend to them, or that I'll even be online at that time. Still, others can probably help too.)

    Most of the time, if there are errors, nothing is damaged. So if you need to use your installed system, feel free to do so.

  • Assuming no errors, reboot (properly, not by holding down your power button or unplugging your computer). Remove the live CD/DVD/USB so that you boot to your installed system. It should boot fine--the start of /dev/sda1 was not moved.

    If it does not boot, then boot from the live CD/DVD/USB again and use any of the methods given here (or if you prefer, any of these) to reinstall GRUB to the Master Boot Record. That should let it boot again. The particular method I recommend in this situation (which I emphasize, I do not think will occur) is this one, because I can fill in all the details for you of what commands you need to run (based on the information you've provided about your partitions):

    sudo mount /dev/sda1 /mnt
    sudo grub-install --root-directory=/mnt /dev/sda
    

    Since you have no separate boot partition and your installed system's root partition is /dev/sda1, that's it. Then reboot, and your system should boot.

After booting back into your Kubuntu/Ubuntu system, there are a couple of things you should check. (This is unrelated to and independent from whether or not you had to reinstall GRUB to the MBR as described above.)

  • Check to make sure your / partition has really expanded. You can check this however you like; in Dolphin perhaps. Or run df -h and compare it with the output of df -h from before.

  • Check to make sure that the swap partition is still being used. Run:

    swapon -s
    

    If you get something like what you got when you ran this before, great! If you get no output at all, that means swap is not in use. In that case, you'll have to check for what the swap partition is now numbered as (by running sudo parted -l or sudo fdisk -l) and then edit the swap line in /etc/fstab to provide that device name. I can provide additional assistance or more detailed instructions for that on request (or perhaps find another question where more detailed information is given).

    The swap partition will probably continue to be used, though, because most partitions including linux-swap are identified in fstab files by their UUID's these days (which don't change unless the partition is actually deleted and re-created, or, in the far less likely scenario, if the UUID is deliberately changed). Therefore, even if the device name off the swap partition changed as a result of performing the operations detailed above, your swap partition will most likely continue being used automatically.

If you didn't have to reinstall GRUB to the MBR from the live CD/DVD/USB (which you probably didn't), then I recommend running this command from your installed Ubuntu system after verifying that everything is working properly:

sudo update-grub

That's usually sufficient to remove any GRUB entries associated with the old operating system (that you've deleted).

Another Option is to Keep the Old Partition

According to the output of df, only 2.8 GB of the 136 GB in your old EasyPeasy partition is used. The rest of this space is already available for you to use. If the partition is not mounted, you can mount it in the Devices list in Nautilus (but it was mounted when you ran df).

If you encounter permissions problems, you can simply change the ownership permissions in the partition wherever you want to create your own files. The most logical ways to do this would be:

  1. Create a folder in the root of the EasyPeasy partition, or
  2. use your old EasyPeasy home folder.

Creating a Folder in the Root of the EasyPeasy Partition

The EasyPeasy partition has no volume label (you can change this in Disks if you like). So it's mounted by its UUID. To go to its root directory in a Konsole, run:

cd /media/5f92*

You can then create a folder for your files:

sudo mkdir Storage

(Call it whatever you like, it doesn't have to be Storage.)

And give ownership of this folder to your user so you don't have to be root to use it:

sudo chown $USER:$USER Storage

(You can keep $USER as it is or replace it with your username; either way works. (Don't write $username where username is your username.)

Using Your Old EasyPeasy Home Folder

You might already have the full ability to read, create, and modify files everywhere inside your old EasyPeasy home folder. This will happen if the UIDs of your old EasyPeasy user and your current Kubuntu user happened to be the same.

If that's not the case, then in your old EasyPeasy home folder, you can run:

sudo chown -R $USER:$USER .

The -R causes this operation to be performed recursively.

Removing the EasyPeasy System But Keeping Its Partition

2.8 GB is an insignificant amount of space compared to the other ~133 GB that are already free in the old EasyPeasy partition. I did not interpret your question as being about freeing that space--I interpreted it as asking how to reclaim the rest for your Kubuntu partition.

However, if you don't want to repartition, but would like to clear out the files from the old EasyPeasy partition, you can:

  1. Simply delete all the files in the old EasyPeasy partition, then run sudo update-grub. When GRUB is updated, it checks what operating systems exist. If an OS no longer exists on a partition, GRUB will generally not list it.

  2. Format the the partition (you can do this in Disks), then run sudo update-grub.

    Your Ubuntu system uses KDE (Kubuntu) but you reported installing regular Ubuntu first and then installing KDE, so you should still have GNOME. Therefore, you should still have gnome-disk-utility (the package that provides Disks), or if you don't, you should be able to install it without pulling in too many dependencies that you already have.

    Then you'll have to create whatever ownership and permissions you want for the drive.

  3. Use the OS-Uninstaller utility to automate formatting the partition and updating GRUB, so it's one step instead of two. For this, see LovinBuntu's answer.

    Once you do that, you'll still have to create whatever ownership and permissions you want on the newly formatted drive.

If you keep the EasyPeasy system or even keep just its partition, the space in the EasyPeasy partition will not help you avoid running out of space from putting files in your home directory (of the [K]Ubuntu system), nor will it keep you from running out of space from installing lots of software. It will simply act like another drive you can use. (Like an external drive, except that since it's on the same physical disk as your installed system, it's not suitable for backups.)

From a data storage perspective, keeping the old EasyPeasy system and using its partition is very similar to removing the old EasyPeasy system but keeping its partition and using it. However, if you're going to keep the partition, you may want to remove the system (in any of the three ways listed above) anyway, since it no longer serves any purpose, its folders could confuse you (as they're named the same as some of the folders in your new system), and updating GRUB after removing it will cause the EasyPeasy option to drop from the boot menu.

Eliah Kagan
  • 117,780
  • I wish I could repay you, You are amazing people, and I appreciate what you have done to help me, Elijah, I thank you especially for you have understood me even when I was not fully here. – UnveiledCorgi64 Apr 05 '13 at 04:24
  • @UnveiledCorgi64 You're welcome. ...Does this mean it worked then, without any problems, and your new Kubuntu system has a whole bunch more space available? – Eliah Kagan Apr 05 '13 at 04:25
0

To delete Ubuntu from your Kubuntu:

  1. Install OS-Uninstaller in your Kubuntu session
  2. Run it, you will see a menu asking which OS you want to remove, similar to the one below: enter image description here

  3. Select Ubuntu (sda6), click the OK button.

  4. Finished !

EDIT: At this point, your question is fully answered: your old OS will be deleted, its space will be freed and accessible from Kubuntu, so you can use it the way you want (you can put data in it, or install another OS in it, or else). Optionally, you can repartition your disk the way you want, but that's a risky operation, and as you did not ask it, I would not advise it.

LovinBuntu
  • 3,615
  • 2
  • 20
  • 21
  • While a technique that incorporates the graphical OS-Uninstaller utility could be used, does this really do what the OP has asked? Removing the old system is the easy part. My understanding is that OS-Uninstaller does not automatically resize the other OS(es) partitions to take up the newly available space. Does it? My understanding is that after running OS-Uninstaller, the OP would still have to perform every step but one from my answer, in GParted. The OP says: "what I want is to delete the non-working version to free up the space on the hard-drive for the working version." – Eliah Kagan Apr 05 '13 at 18:31
  • Yes, it does entirely does what OP asked. It will format the correct partition, and update the bootloader menu. The space will be freed and accessible from Kubuntu, so OP can use it the way he wants (he can put data in it, or install another OS in it, or else). All of this in 1 click. No need for a long procedure (and possible mistakes) like yours. – LovinBuntu Apr 06 '13 at 10:37
  • Eliah, your understanding is that OP asked for resizing the partition, but that's not correct, please read the OP message again. And by the way, resizing partitions is a risky operation. As it is not required to achieve what OP asked, better not recommending it. – LovinBuntu Apr 06 '13 at 10:37
  • Then wouldn't an even simpler, lower-risk option be to do nothing at all? Most of the space in sda6 is free, and the OP clearly can mount it (it's mounted in the output of df). Only 2.8G is used in that partition; 136G is free. In the sense you're using, the space is already available for the OP to use. I've been assuming the OP wants something s/he doesn't already have. I recommend you consider updating your answer to explain the alternative of doing nothing (at most, changing ownership/permissions to enable full access to some reasonable place in sda6, like the old home directory). – Eliah Kagan Apr 06 '13 at 16:23
  • Please stop being rude. You know my answer is correct. – LovinBuntu Apr 06 '13 at 18:53
  • Nothing I have said has been rude or insincere in any way, and I object to the false accusation that I have been rude to you. In particular, I really do think you should expand your answer to explain how it is similar to and different from keeping the other existing system without modification, or with minimal modification. Other people have different opinions and perspectives from you. When we disagree with you, it is wrong for you to tell us to keep quiet. Please don't do that. – Eliah Kagan Apr 06 '13 at 19:02
  • I feel rude that you say my answer does nothing the OP already has, just after I explained how it exactly answers the OP request, by deleting the old OS, freeing the space taken by the old OS (yes, it's 2.8GB), and updating the bootloader. But I may have bad interpretation in your intention, if so, sorry. Again, resizing partitions is risky, and is not required to answer the OP request. So please edit your answer to make this operation an option. And I will edit my answer to mention this option, so that we have consistent answers. – LovinBuntu Apr 07 '13 at 09:32
  • I've edited my answer to include keeping the partition, and the various options within that, including keeping it but removing the OS from it. I believe this edit fulfills your request. I still do not believe that this is what the OP was asking for, and I stand by everything I have said, including all my comments here. Furthermore, the phrase "nothing the OP already has" first appears in your comment--I never said those words. In terms of storage, your method is basically the same as what the OP already has. I've now explained that in my answer; this should clarify it for both the OP and you. – Eliah Kagan Apr 07 '13 at 18:25