Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

noob question here. My laptop is dual booted with windows in one partition and ubuntu 12.04 in another. I recently wanted to do a fresh install of ubuntu, so what I did was pop in a ubuntu installation disk and reformatted. On the part where I partition the drive, I deleted the old partition where old ubuntu was installed and replaced it with a new partition where the new ubuntu should be placed. I didn't touch windows. I assumed it will just replace the old one, but it didn't. When I boot, I see Ubuntu(the newly installed one), Windows, and Ubuntu (The old one I have). How do I get rid of the old one? I tried to boot to the old one and I'm surprised that I can still boot to it. How is it possible that I can still boot to it and how much is it using on my drive? D:

Please tell me how to get rid of it.

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000325dd

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       13055   104857600    7  HPFS/NTFS
/dev/sda2           13055       30402   139338753    5  Extended
/dev/sda5           13055       22641    76998656   83  Linux
/dev/sda6           22641       23014     2998272   82  Linux swap / Solaris
/dev/sda7           23014       30402    59339776   83  Linux

Model: ATA SAMSUNG HM250JI (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size    Type      File system     Flags
 1      1049kB  107GB  107GB   primary   ntfs            boot
 2      107GB   250GB  143GB   extended
 5      107GB   186GB  78.8GB  logical   ext4
 6      186GB   189GB  3070MB  logical   linux-swap(v1)
 7      189GB   250GB  60.8GB  logical   ext4



/dev/sda7 on / type ext4 (rw,errors=remount-ro,commit=600)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/dvorak/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=dvorak)
/dev/sda5 on /media/299279fa-1533-4471-964a-f820df7e1c54 type ext4 (rw,nosuid,nodev,uhelper=udisks)

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda7              56G  2.7G   51G   6% /
none                  928M  260K  928M   1% /dev
none                  934M  340K  933M   1% /dev/shm
none                  934M   96K  933M   1% /var/run
none                  934M     0  934M   0% /var/lock
/dev/sda5              66G  2.4G   60G   4% /media/299279fa-1533-4471-964a-f820df7e1c54
share|improve this question
    
Hello.. I edited it. Looking forward for an answer. :) I believe the one with sda5 is the one with the old installation. I remember seeing it in the boot options along with windows and the newly installed ubuntu. –  Dvorak Ivan Jan 14 '13 at 13:48
add comment

2 Answers 2

  1. Boot your computer with Ubuntu live CD/USB.
  2. Open Nautilus and carefully check if you have any data to preserve in the partition (sda5?) where your old Ubuntu installation is, especially looking at your Home sub-folders, e.g. Documents, Downloads, Pictures, etc. and either copy & paste or move them to your new Home sub-folders.
  3. After making sure that you no longer need anything on the old partition, start GParted Partition Editor, and be very careful to delete that old, unneeded partition (sda5?) and not any other.
  4. You can then choose from a number of options to use this new unallocated free space at this stage.
  5. Finally, boot your computer normally and update the Grub menu by entering this command in terminal: sudo update-grub
share|improve this answer
    
Thanks Eliah, I've edited the answer now as per your warning. –  Sadi Jan 15 '13 at 9:23
add comment

mount and df show that the new Ubuntu system (which you want to keep) has its root filesystem installed on sda7. You're correct that the old Ubuntu system has is root filesystem on sda5.

Typically, Ubuntu has two partitions (and sometimes more, if you set it up that way).

  • A partition providing / (the root filesystem). In your new system it's sda7.
  • A partition providing swap space. In your new system it's sda6.

You said you removed your old Ubuntu partition? I don't know what you did remove, but perhaps it was the previous system's swap partition?

Assuming you have no important documents or other valuable files in the old Ubuntu system (i.e., stored on sda5), you can safely remove the partition. However:

  • Do not remove the partition while booted from the disk on which it resides. That can cause corruption, or at least system instability. It is widely warned against.

    Furthermore, you cannot make modifications to partitions that are mounted, so you would not be able to expand your new Ubuntu system's root filesystem to take up the space.

Instead, boot from an Ubuntu live CD/DVD or live USB (like what you used to install Ubuntu), and run GParted.

In GParted in the live environment, you can make whatever changes you like.

Remove sda5. Slide sda6 (your swap partition) as far to the left as it will go. Then you can expand sda7 to the left, to fill up the newly unallocated space. Remember:

  • To apply your changes by clicking the green check mark.

  • That when you dynamically resize a partition, even when expanding it as in this case, there is a small but significant chance of data loss.

    You should always have backups of everything important--before performing this procedure would be a good time to make sure your backups are up to date.

Then quit GParted and reinstall GRUB2 to the Master Boot Record.

  • You might not have to do this, but you probably will, and you may as well do it now rather than having to boot from the live CD/DVD/USB again.

You can use the method here or any of these techniques. Make sure to check and see if your partitions are renumbered (after GParted runs). If worse comes to worse, you can always do it again.

Alternatively, you might prefer to avoid dynamically resizing any partitions, and just create one or more new storage partitions in the space freed by removing sda5. (See Sadi's answer.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.