how to resize root partition in sda2

Asked by sagar joshi

                Boot Info Script 0.55 dated February 15th, 2010

============================= Boot Info Summary: ==============================

 => Windows is installed in the MBR of /dev/sda

sda1: _________________________________________________________________________

    File system: ntfs
    Boot sector type: Windows Vista/7
    Boot sector info: No errors found in the Boot Parameter Block.
    Operating System:
    Boot files/dirs: /bootmgr /Boot/BCD

sda2: _________________________________________________________________________

    File system: ntfs
    Boot sector type: Windows Vista/7
    Boot sector info: No errors found in the Boot Parameter Block.
    Operating System: Windows 7
    Boot files/dirs: /Windows/System32/winload.exe /wubildr.mbr
                       /ubuntu/winboot/wubildr.mbr /wubildr
                       /ubuntu/winboot/wubildr /ubuntu/disks/root.disk
                       /ubuntu/disks/swap.disk

sda2/Wubi: _________________________________________________________________________

    File system: ext4
    Boot sector type: -
    Boot sector info:
    Operating System: Ubuntu 10.10
    Boot files/dirs: /boot/grub/grub.cfg /etc/fstab

sda3: _________________________________________________________________________

    File system: ntfs
    Boot sector type: Windows Vista/7
    Boot sector info: No errors found in the Boot Parameter Block.
    Operating System:
    Boot files/dirs:

sda4: _________________________________________________________________________

    File system: Extended Partition
    Boot sector type: -
    Boot sector info:

sda5: _________________________________________________________________________

    File system: ntfs
    Boot sector type: Windows Vista/7
    Boot sector info: According to the info in the boot sector, sda5 starts
                       at sector 2048.
    Operating System:
    Boot files/dirs:

sda6: _________________________________________________________________________

    File system: ntfs
    Boot sector type: Windows Vista/7
    Boot sector info: According to the info in the boot sector, sda6 starts
                       at sector 2048.
    Operating System:
    Boot files/dirs:

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ _____________________________________________________

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start End Size Id System

/dev/sda1 * 2,048 206,847 204,800 7 HPFS/NTFS
/dev/sda2 206,848 143,362,047 143,155,200 7 HPFS/NTFS
/dev/sda3 143,362,048 286,722,047 143,360,000 7 HPFS/NTFS
/dev/sda4 286,722,048 625,139,711 338,417,664 f W95 Ext d (LBA)
/dev/sda5 286,724,096 430,084,095 143,360,000 7 HPFS/NTFS
/dev/sda6 430,086,144 625,139,711 195,053,568 7 HPFS/NTFS

blkid -c /dev/null: ____________________________________________________________

Device UUID TYPE LABEL

/dev/loop0 34e31812-debc-44ef-8574-ef87f31ed1d8 ext4
/dev/sda1 C6C68401C683EFCB ntfs System Reserved
/dev/sda2 E4709023708FFA96 ntfs
/dev/sda3 B858B56C58B529D0 ntfs New Volume
/dev/sda4: PTTYPE="dos"
/dev/sda5 C840D0AC40D0A30C ntfs New Volume
/dev/sda6 680828EC0828BAC8 ntfs New Volume
/dev/sda: PTTYPE="dos"
error: /dev/sdb: No medium found

Question information

Language:
English Edit question
Status:
Solved
For:
Wubi Edit question
Assignee:
No assignee Edit question
Solved by:
bcbc
Solved:
Last query:
Last reply:
Revision history for this message
houstonbofh (leesharp) said :
#1

The easiest way is with gparted on a live CD. You can use the Ubuntu Live CD, or the gparted live cd to do this.

BE CAREFUL! You can break stuff irretrievably with this tool!

Revision history for this message
delance (olivier-delance) said :
#2

For the moment, please wait advise from bcbc. I'm affraid it's not so simple.

Revision history for this message
bcbc (bcbc) said :
#3

Yes, Delance is right, please don't use Gparted or you'll probably kill Windows. I'll respond here soon with more information.

Revision history for this message
bcbc (bcbc) said :
#4

When you install with wubi it creates a virtual disk (virtual partition if you like) the root.disk. You can select the size between 3GB and 30GB (space permitting) at install time, but after that it is fixed.

Once it is full you have the following options:
1. Delete unnecessary stuff
2. Move files to the /host partition (that is outside of the root.disk)
3. Create a separate virtual disk for the /home partition
4. Resize the virtual disk
5. Reinstall and choose a larger disk
6. Create a proper partition and migrate your wubi to it.

1 and 2 are probably the easiest.

5 is the best if you just installed but made it too small

6 is good if you are using Ubuntu a lot and you want to make it more stable, or you need more than 30GB. http://ubuntuforums.org/showthread.php?t=1519354

3. See the Wubi Guide https://wiki.ubuntu.com/WubiGuide

4. I would only attempt this if you have a lot of customization you don't want to lose, and you don't want to migrate to a real Ubuntu install. You have two (reasonable options). One is to create a duplicate root.disk that is larger. The other is to attempt to resize the existing disk. Do not use LVPM (it removes grub2 as it has a dependency on grub legacy).

Create larger duplicate root.disk: http://ubuntuforums.org/showthread.php?t=1625371
I've tested this (I wrote the script) but it hasn't received any community testing yet (it doesn't modify the current root.disk)

True resize on the existing root.disk: http://ubuntuforums.org/showpost.php?p=10517590&postcount=19
(I haven't tested this technique - I recommend backing up the root.disk before attempting)

Revision history for this message
sagar joshi (sagarrjoshi) said :
#5

Hi bcbc,

i am very new to ubuntu. Hence can you give me step by step procedure for option 2 or 3. I downloaded wubi-add-virtual-disk script & tried the sudo wubi-add-virtual-disk /home 15000 command from terminal window, but says no such command.

Revision history for this message
bcbc (bcbc) said :
#6

Option 2:
Open up nautilus (ALT-F2, "nautilus /host")
This will show you your windows host partition. Then in a separate nautilus
window (from Places menu) e.g. Pictures, select and move files to a folder
under /host.

This removes them from the virtual disk, freeing up space. If you want to
move to another Windows partition (i.e. not the /host) then you can find
these under the Places menu - they will be mounted as /media/xxxx where xxxx
is either the volume label if it exists or the UUID. This will also free up
space in the virtual disk.

An additional benefit is that your files are safer off the virtual disk as
they are stored directly on the partition, rather than on the virtual disk
which is a single file on the windows file system.

Option 3:
The command to add a 15GB virtual disk for /home is (you're missing the "sh"
part):
sudo sh wubi-add-virtual-disk /home 15000

Please note with option 3, it saves a backup of /home on the root.disk (so
you can make sure it worked). When you are sure it's working fine, then you
have to delete that backup to make space. As it says in the guide:
"You should now reboot. If you are happy with the result, you can now remove
/home.backup. To undo the changes remove /home, copy rename /home.backup to
/home and remove the /home line in /etc/fstab."

> Hi bcbc,
>
> i am very new to ubuntu. Hence can you give me step by step procedure
> for option 2 or 3. I downloaded wubi-add-virtual-disk script & tried the
> sudo wubi-add-virtual-disk /home 15000 command from terminal window, but
> says no such command.
>
>

Revision history for this message
sagar joshi (sagarrjoshi) said :
#7

Hi,

I have created a virtual disk for home.
now for 1st option, can you tell me how to know which files can be safely moved? i.e without affecting their dependendancies in programs.

Revision history for this message
Best bcbc (bcbc) said :
#8

What files are you talking about moving? If you've already moved /home to
the new virtual disk remember that you won't see any space freed up on the
root.disk until you delete the /home.backup. But after that you should have
lots of space available.

Other files you can clean up are older kernels not being used (always keep
two working kernels). And you can use apt-get autoclean and (possibly)
apt-get clean to purge cached package files (look these up before running:
autoclean is a good idea as it cleans obsolete packages from the cache,
clean might mean you have to download packages again to reinstall).

Revision history for this message
sagar joshi (sagarrjoshi) said :
#9

thanks for your help

This solvels my problem

Revision history for this message
bcbc (bcbc) said :
#10

Great! I'm glad to hear your issue is resolved.

Just a reminder... since Wubi uses virtual disks there is a greater chance of data loss if the root.disk is corrupted. So I recommend making sure your backups are up to date. If you find that you're using Wubi more than Windows in the future, and you are more comfortable with partitioning etc. then it's recommended (not required) to migrate to a normal install.