I don't have a lot of space on my D: drive and Ubuntu is taking 15 gigs of it so I wonder, is there a way of moving Ubuntu from D: to C: while keeping the files that exists on Ubuntu?
Thanks

- 33,360
1 Answers
- Make backup copy of all important data in Ubuntu into an external device. If the following does not work, you may lose all your data.
- Copy the
root.disk
file fromD:\Ubuntu\Disks
to a safe place. You may put it in your "My Documents" for the time being. - Uninstall Ubuntu using Control Panel.
- Reboot.
- Install Ubuntu in C: using WUBI. Make sure when installing to C: that you choose the same Disk Size as the Disk you already have. This prevents errors.
- Replace
C:\Ubuntu\Disks\root.disk
with the root.disk you had copied before. - Reboot.
One more step
See https://askubuntu.com/a/55029/14916 for details (Thanks to @bcbc for pointing out this part.) The following is taken from that answer:
e.g. if D:
is /dev/sda2
and C:
is /dev/sda1
, then you'd hit 'e' on the first entry of the grub menu and change:
set root=(hd0,2)
becomes set root=(hd0,1)
Delete the line - search --no-floppy xxx
(as this overrides the previous set root command using the old UUID)
linux /boot/vmlinuz-xxxx root=/dev/sda2 ...
becomes linux /boot/vmlinuz-xxx root=/dev/sda1 ...
This is a one-time override - hit Ctrl+X to boot, and make sure you run sudo update-grub
after booting to fix the grub.cfg menu so it works the next time.
PS: There may be some variations. (hd0,2)
could be (hd0, msdos2)
or (/dev/sda, msdos2)
depending on the version of Grub. Also root=/dev/sda2
may be root=UUID=xxxxx
-
Make sure when installing to C: that you choose the same Disk Size as the Disk you already have and set everything exactly as you had it set to before. Prevents errors. (ie: Same Username and Password, etc...) – japzone Dec 03 '12 at 18:25
-
But if I want to make the size of ubuntu larger, for example 30 gigs instead of 15? – Yehonatan Tsirolnik Dec 03 '12 at 18:29
-
1@YehonatanTsirolnik That gets more complicated and is the topic of a different question. It'll involve booting from an Ubuntu LiveCD/USB, making a new Disk Image, and Transferring the Data from the Old Disk to the New. Open a new question for that. – japzone Dec 03 '12 at 18:34
-
@YehonatanTsirolnik: This increasing the virtual disk size is a separate question, answered here: http://askubuntu.com/questions/118300/increase-size-of-root-partition-after-installing-ubuntu-in-windows . Ask a new question if needed. – user68186 Dec 03 '12 at 18:35
-
Okay, thank you very much :) This helped me a lot. – Yehonatan Tsirolnik Dec 03 '12 at 18:43
-
You are most welcome. – user68186 Dec 03 '12 at 18:44
-
This answer is missing some important info... the partition info is used by grub to boot the wubi install (and this is contained on the root.disk). So the first time you boot, you have to tell grub about the new partition. Check the bottom of this answer for more info: http://askubuntu.com/a/55029/14916 – bcbc Dec 04 '12 at 21:06
-
@bcbc Thank you very much for pointing out this important step. I have taken parts of your answer to fix mine. Let me know if this makes sense. – user68186 Dec 04 '12 at 21:22