Long story short. I accidentally removed my GRUB, and my partition set with mount point '/'. I did remedy this by re-installing Ubuntu from a liveCD (USB), and set the mount point for the new partition (with 2nd version of Ubuntu) as '/', and the Ubuntu installer reinstalled GRUB. (I had tried using boot-repair, from liveCD but it was not working)
My question is: Is it possible for me to remove this old system to get back the used space, and re-assign my original Ubuntu to the mount point '/', without having to copy reformat et cetera?
I do not have a mass storage device which would have the space, to hold everything on this partition (current/1st Ubuntu).
No optical drive.
Lots of settings, and other things I wish to save
Computer was pre-packaged with Ubuntu, making finding drivers un-needed (would rather not have to go through hassle of finding everything, because I know some did not work in liveCD)
df -h --total
(Edit: For more information) The netbook I have was pre-installed with Ubuntu, so it was not set up in the 'normal' way i.e. my OS was not set up on the same partition as the MBR, and GRUB. There is also a recovery partition which contains the Ubuntu recovery. The boot information was set at / for a mounting point.
sda1 -- FAT32 Partition
sda2 -- FAT32 Partition
sda3 -- 2nd Ubuntu Install root directory ' / '
sda4 -- encrypted swap
sda5 -- 1st Ubuntu Install home directory ' /home '
sda7 -- Other OS (Ubuntu 14.04)
sda8 -- Unused
zram0 and zram1 -- swap partitions for linux
- From liveCD- opened terminal to clone /sda5 --
sudo dd if /dev/sda5 of=/dev/sda7 conv=notrunc,noerror
- From new terminal did
watch -n5 'sudo kill -USR1 $(pgredp ^dd)to see progress of dd (this took about 24 hours to finish)
- Tried to load from hard-drive. System loaded into grub command line (not bootloader).
- Ran liveCD again installed boot-fix, ran through repair.
- Default OS is now set to sda5 in GRUB, still have messed up partition mount points.
(Up to step 5 OS was intact)
- Formatted sda7.
One of these last 2 steps destroyed GRUB, and bootability of partitions (i.e. none of the 3 Ubuntus will load)
- liveCD, tried boot-repair 3 times, after 1st "fix" was unable to access GRUB options in advanced options of boot-repair (could not purge/reinstall GRUB)
- Mounted sda5, to see if I could get files off, but the disk was unreadable. (Guessing due to resize in step #7)
- Wiped everything and re-installed Ubuntu.
- Unfortunately I have to redo all my settings, fortunately I do keep backups of important data, but still lost some.
- Lesson to myself. Be careful when partitioning.
Although it looked like booting would work with sda3 intact, it seems as if some of the boot information may have been stretched across partitions. Cloning from sda5 to sda7 (with dd) did not work either. (sda7 would not boot after sda5 was cloned over, but probably because of size difference, and cloning needs exact size to duplicate). So i formatted sda7, and expanded sda5. This caused my sda5 information to get messed up. If I only had information (not full system tweaks) the answer below would most likely work.
The biggest problem I had is that when using the liveCD, I had to mount my drives manually (using terminal,
mkdir /temporary/folder/ ,
mount /dev/sdXY/ /temporary/folder), but not always.. sometimes the system automatically mounted, so I would have to dismount, if I wanted to change anything. It was inconsistent.