2

So I am using a bootable usb with 12.04 on it to run gparted. What I would like to do is keep the win7 partition and merge/redo the other partitions for ubuntu use. I am not quite sure what the best route to take would be. I don't mind reinstalling ubuntu if needed. I really just want the 15.42GB unallocated to be usable by ubuntu for saving files.

Well since I can't post a picture it will probably be impossible to answer....

Here are the partitions in order from left to right in gparted.

  1. unallocated 64mb
  2. sda2 ext4 10gb
  3. sda3 ntfs 121gb
  4. unallocated 15.42gb
  5. sda1 extended 2.5gb
    sda5 linux-swap 2.5gb

Here is the fdisk results from the drive.

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x90000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1       307337214   312580095     2621441    5  Extended
/dev/sda2          129024    21100543    10485760   83  Linux
/dev/sda3   *    21100544   275006793   126953125    7  HPFS/NTFS/exFAT
/dev/sda5       307337216   312580095     2621440   82  Linux swap / Solaris

Partition table entries are not in disk order

Disk /dev/sdb: 1999 MB, 1999568384 bytes
62 heads, 62 sectors/track, 1015 cylinders, total 3905407 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00018276

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          62     3901659     1950799    c  W95 FAT32 (LBA)

Disk /dev/sdc: 64 MB, 64487424 bytes
2 heads, 62 sectors/track, 1015 cylinders, total 125952 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6f20736b

This doesn't look like a partition table
Probably you selected the wrong device.

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   ?   778135908  1919645538   570754815+  72  Unknown
/dev/sdc2   ?   168689522  2104717761   968014120   65  Novell Netware 386
/dev/sdc3   ?  1869881465  3805909656   968014096   79  Unknown
/dev/sdc4   ?  2885681152  2885736650       27749+   d  Unknown

Here is the fstab file

# /etc/fstab: static file system information.

Use 'blkid -o value -s UUID' to print the universally unique identifier

for a device; this may be used with UUID= as a more robust way to name

devices that works even if disks are added and removed. See fstab(5).

#

proc /proc proc nodev,noexec,nosuid 0 0
/dev/sda2 / ext4 errors=remount-ro 0 1
UUID=777828dd-00e5-4efe-a616-3e70949d6559 none swap sw 0 0

Current free-m
total used free shared buffers cached
Mem: 1885 1268 616 0 152 769
-/+ buffers/cache: 346 1538
Swap: 2499 0 2499

1
  • Open a terminal and run sudo fdisk -l then add the ouptut to your question Jul 28, 2012 at 17:44

1 Answer 1

0

Boot the live medium, go to gparted - you will probably have to right click on the swap and swapoff. If the extended and swap have padlocks next to them they are mounted - swapoff will deal with that.

Then you will be able to move the extended to the left to include the unallocated space. Then uou can create a new logical inside the extended and format it.

However I would not do that - I assume that sda2 is your ubuntu install.

I would delete the swap, then the extended and then create a new extended using all of the unallocated space, create a NEW swap with size 2.5Gb and then a new ext4 partition with the remaining space.

Much quicker - now all you need to do is change the swap reference in your fstab

Close gparted.

Open a terminal and run

sudo blkid

Make a note of the UUID you get against the swap partition.

Mount your install so you can edit it

sudo mount -t ext4 /dev/sda2 /mnt

Open the file for editing

gksudo gedit /mnt/etc/fstab

Look for the swap line and change the UUID to suit, I put my swap UUID and fstab line below for reference

/dev/sda8: UUID="9237bdd4-1976-4532-9c6f-558fb7b4a6f5" TYPE="swap"


# swap was on /dev/sda7 during installation
UUID=9237bdd4-1976-4532-9c6f-558fb7b4a6f5 none swap sw   0       0

Your fstab shows

/dev/sda5 none swap sw 0 0 

Edit that so it is

UUID=yourUUIDnumber none swap sw 0 0 

Once done - save and exit.

You can check that the swap is being used

sudo swapon -a
free -m
12
  • when I run "sudo mount -t ext4 /mnt /dev/sda2" it gives me "mount: /mnt is not a block device" back. What went wrong? I was able to change the partitions in gparted as you said above.
    – Mark
    Jul 28, 2012 at 18:37
  • whoops - edited command Jul 28, 2012 at 18:45
  • now when I run "gksudo gedit /mnt/etc/fstab" gedit opens but nothing is loaded. There is a fstab and Untitled document but no text anywhere. Do I just copy your example in the fstab file with my UUID?
    – Mark
    Jul 28, 2012 at 18:54
  • ok - try gksudo nautilus - then click on the drive in the left panel - that should mount it - navigate to /etc/fstab and right click open with gedit - you need to edit your file to have your NEW UUID Jul 28, 2012 at 18:58
  • OK so I redid the mount and gedit after you edited it. I am not quite sure exactly how the new UUID needs to be replaced in the fstab file.Here is what it says in the fstab file.# <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc nodev,noexec,nosuid 0 0 /dev/sda2 / ext4 errors=remount-ro 0 1 /dev/sda5 none swap sw 0 0
    – Mark
    Jul 28, 2012 at 19:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .