How to Resize Wubi root.disk (Windows Install)

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
User avatar
elfaure
Level 1
Level 1
Posts: 41
Joined: Tue Jun 18, 2013 10:18 pm

How to Resize Wubi root.disk (Windows Install)

Post by elfaure » Wed Jul 03, 2013 8:11 pm

This method has been depreciated and determined UNSAFE. Use this method instead: See "In place Resizing"

http://ubuntuforums.org/showthread.php?t=1625371&s=8f0c5778bb8486713fdc4e6b6204b48e&p=10590851#post10590851

#####################################################################################

(Request for sticky) :D

[Edit] Retracted request for sticky. Can someone review this to see if its safe? According to the Linux man page for e2fsck, this is not supposed to be executed on a mounted file system, yet when you are you booted into LM and running your Wubi this file system is mounted. So maybe I got lucky; that would explain the extra fsck's run and the double reboots. Maybe it is safer or even imperative to do this from a Live CD? It did work for me as documented, but may be ill advised until further review.

http://linux.die.net/man/8/e2fsck

#########################################################################################

This guide is for Linux Mint (LM) 15 Mate Olivia (32/64 bit) and has been confirmed working. It may work on other installations too (with no [Cinnamon 32/64] or minor modifications like maybe substitute fsck for e2fsck) but has not been tested.

Background: There are two distinct ways to install LM. The best way is a full install from a live CD, booting from it in which case LM gets its own partition(s). Resizing user space is then very easy using GParted, adjusting the slider to decrease or increase file system root space. A second way to install LM is to insert the live CD while already booted into Windows. This is the mint4win or "Wubi disk" installation method in which the main difference is a dedicated partition is not needed nor created, and LM can be installed on any existing partition (including the Windows partition). The other main difference and the reason for this guide is there is no apparent way to change the virtual disk size once defined and installed. This discussion focuses on the latter installation method and how to adjust the size of that space once installed.

Technically, the wubi disk or the Windows (DOS) file linuxmint\disks\root.disk is the backing file for a fuse-mounted loop device which gets mounted over this file on booting LM. If you run the mount command, you will see this; it is the only mountpoint for LM. There are no mountpoints for LM over /dev/sd_ because there are no partitions to mount. Boot, root, and user space are all contained within this virtual file space. There are a few ubuntu guides, and a few more blog posts about how to change this size of this (ubuntu) wubi file, but nothing I found worked as documented, LM is ubutu based but unique in some aspects, so I used a guide that was close to being correct, and modified it per what I found needed to be done to make it work with Mint 15. I've tested this on two machines today, and increased both wubis to 32GB in less than 5 mins with this guide. It really only involves two commands, then letting the system reboot a couple of times to fix a few things (like a DOS chkdsk /f) and then its done. Here's what you need to do:

But *before* you begin, **make a backup copy of your /linuxmint/disks/root.disk**. I've done this from inside Windows. This could take quite some time over a slow network (2-5 hours) or about 1/2 hour on a local HDD. If anything goes wrong, simply boot from the live CD or Windows, and copy this file back to where you copied it from and you will be back to where you started. If (when) everything checks out after the resize, you can delete this file.

#########################################################################################

Now boot into your installed LM (not from Live CD). The remainder of this guide is done while running your installed LM (and running Wubi).

1. Mount the NTFS partition where Linux Mint is installed [in my case it's already mounted as host because I'm running Linux Mint when doing this. To check it just type "mount". If you're not sure about your disk "number" (such as 1 in /dev/sda1), type "sudo fdisk -l" to check the number based on its size].

2. Shows you the size of your existing wubi (human readable).

Code: Select all

du -h --apparent-size /host/linuxmint/disks/root.disk
3. Get an interactive root shell or type "sudo" before then next two(2) commands in steps 4. and 5. These two (2) commands do not work unless you are root.

Code: Select all

sudo -i
4. Check and fix any problems with wubi before resize. Fsck command does not work here.

Code: Select all

e2fsck -f /host/linuxmint/disks/root.disk
5. Resize wubi to 32GB max size (may be possible to make larger but staying within the limits of what is documented 30-32GB is max size). You can use any size from 8GB (default) to 32GB (maximum-TBD).

Code: Select all

resize2fs /host/linuxmint/disks/root.disk 32G
6. Repeat command, step 2. Size should now say 32G.


You may think you are done, but you aren't quite yet. :roll: After rebooting my systems, some additional fixes and checks were required.

After the first reboot (manual-do it now), when prompted to fix any errors, allow by typing "F" for fix as instructed. Let the system reboot a second time (automatic), then it will tell you its checking for errors in which case you do nothing and let Grub2 do its work. After the second reboot, you will be completely done with the procedure. :)

It may appear like you have messed up your virtual disk, but just relax, and after two reboot cycles and following the prompts to fix and let check any problems, you will be finally rebooted back into Mint with a 32GB virtual disk size and now plenty of room to play. Mission (impossible) accomplished. Better to do the full install ideally with dedicated partitions for every user space, but at least this is a saving grace for undersized wubi installers. :D
Last edited by elfaure on Sun Jul 07, 2013 3:31 pm, edited 8 times in total.

User avatar
karlchen
Level 19
Level 19
Posts: 9412
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: [Guide]: How to Resize Wubi root.disk (Windows Install)

Post by karlchen » Sun Jul 07, 2013 7:10 am

elfaure wrote:(Request for sticky) :D
Hm, has it not been made a sticky here already? :wink: => [url=http://ubuntuforums.org/showthread.php?t=1625371](Tutorial) HOWTO: Resize the WUBI virtual disk[/url], hm, to be precise go down to the post labelled [url=http://ubuntuforums.org/showthread.php?t=1625371&s=8f0c5778bb8486713fdc4e6b6204b48e&p=10590851#post10590851]In place Resize of root.disk[/url]
Last edited by karlchen on Sun Jul 07, 2013 11:35 am, edited 1 time in total.
Image
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.21a 64-bit
Ubuntu 18.04.1 32-bit Mate Desktop, Total Commander 9.21a 32-bit
Windows? - 1 window in every room

User avatar
elfaure
Level 1
Level 1
Posts: 41
Joined: Tue Jun 18, 2013 10:18 pm

Re: [Guide]: How to Resize Wubi root.disk (Windows Install)

Post by elfaure » Sun Jul 07, 2013 9:52 am

karlchen wrote:
elfaure wrote:(Request for sticky) :D
Hm, has it not been made a sticky here already? :wink: => [url=http://ubuntuforums.org/showthread.php?t=1625371](Tutorial) HOWTO: Resize the WUBI virtual disk[/url]
I tried multiple guides for Ubuntu and they failed. My guide is totally different and only involves two (2) key commands. The wikis didn't work either. Apples and Oranges. Grub guides don't work for Grub2. Can you point me to a Ubuntu guide that actually works (even with modification) for LM 15? I couldn't find one, so after figuring it out, I documented it here.

User avatar
karlchen
Level 19
Level 19
Posts: 9412
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: [Guide]: How to Resize Wubi root.disk (Windows Install)

Post by karlchen » Sun Jul 07, 2013 11:28 am

Hello, elfaure.

It is really great and much appreciated that you cared to post your findings as a tutorial. :D - All I wanted to point out was that Ubuntu user bcbc (by the way, from my irrelevant point of view the best Wubi expert in the Ubuntu forum) came to the same result some time ago.

I admit that [url=http://ubuntuforums.org/showthread.php?t=1625371]the first part of the thread[/url] which I pointed to explains a different approach. But further down, there is a post labelled [url=http://ubuntuforums.org/showthread.php?t=1625371&s=8f0c5778bb8486713fdc4e6b6204b48e&p=10590851#post10590851]In place Resize of root.disk[/url].
And the steps which bcbc explains there look much like the ones that you give. Though reading carefully, one will notice that bcbc does not mention that the resized Wubi partition might need some additional fsck before being usable again.

Having the same steps for Wubi and Mint4win installations would be only logical, because Wubi and Mint4win are twins. The differences just are
+ the different programme icons, Ubuntu vs. Mint
+ the different default foldernames, \ubuntu vs. \linuxmint

Kind regards,
Karl
--
P.S.:
Just bookmarked your guide for later reference. - Every once in a while users will want to extend their root.disk, because they have run out of filesystem space.
Image
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.21a 64-bit
Ubuntu 18.04.1 32-bit Mate Desktop, Total Commander 9.21a 32-bit
Windows? - 1 window in every room

User avatar
elfaure
Level 1
Level 1
Posts: 41
Joined: Tue Jun 18, 2013 10:18 pm

Re: [Guide]: How to Resize Wubi root.disk (Windows Install)

Post by elfaure » Sun Jul 07, 2013 11:59 am

karlchen wrote:Hello, elfaure.

It is really great and much appreciated that you cared to post your findings as a tutorial. :D - All I wanted to point out was that Ubuntu user bcbc (by the way, from my irrelevant point of view the best Wubi expert in the Ubuntu forum) came to the same result some time ago.

I admit that [url=http://ubuntuforums.org/showthread.php?t=1625371]the first part of the thread[/url] which I pointed to explains a different approach. But further down, there is a post labelled [url=http://ubuntuforums.org/showthread.php?t=1625371&s=8f0c5778bb8486713fdc4e6b6204b48e&p=10590851#post10590851]In place Resize of root.disk[/url].
And the steps which bcbc explains there look much like the ones that you give. Though reading carefully, one will notice that bcbc does not mention that the resized Wubi partition might need some additional fsck before being usable again.

Having the same steps for Wubi and Mint4win installations would be only logical, because Wubi and Mint4win are twins. The differences just are
+ the different programme icons, Ubuntu vs. Mint
+ the different default foldernames, \ubuntu vs. \linuxmint

Kind regards,
Karl
Hi Karl-

Thanks for the clarification and close-to-working method pointer. I'm far too impatient to read past the first failure I guess. Never found the bcbc method - i just hacked it out. After trying a few guides and blogs, I found one very close to working (I think a blog copy of the one you posted, except it was done while running Wubi and booted into LM) but it still needed just a bit of massaging to complete the task. And this was it: one *key* finding I made was you need to use *e2fsck* NOT fsck before the resize2fs, then its all good. :D

Nowhere did I find a verbatim guide that just worked for LM 15, so I took the time to document it for others. There is no room for question or error when operating on your Wubi disk. Users shouldn't have to dig too far to find this info, or modify this info or make substitutions or try to "figure it out" in my opinion. This is what I had to do, and I found it very frustrating and time consuming to get this accomplished. This is code that should be available to cut and paste into a terminal, preform the simple modification, and get on with your Linux life without the chance of messing it up or following the wrong guide. That's why it should live here (and/or Wiki), not on Ubuntu forums. :wink:

[Edit] After reviewing the bcbc guide you point to, it is flawed in the same way I mention above as my *key* finding. My guide thus corrects this issue.

Another key difference in the bcbc guide is you are not running your Wubi (you have to boot from Live CD). After backing up your root.disk, everything in my guide is done from within a booted LM session while running your Wubi. They look somewhat similar, but if you examine closely they are somewhat different.

Maybe if the resize were done while not actively running your Wubi, the additional fsck's done by Grub2 wouldn't be necessary, but I have not tried this and my Wubi's are already resized and working fine using this guide.

User avatar
elfaure
Level 1
Level 1
Posts: 41
Joined: Tue Jun 18, 2013 10:18 pm

Re: [Guide]: How to Resize Wubi root.disk (Windows Install)

Post by elfaure » Sun Jul 07, 2013 2:44 pm

OP author request for method review. Is this safe?? :?: Please see [Edit] under "Request for Sticky" noted in OP.

Now that I have reviewed the bcbc method and done some thinking about the differences and read the man page for e2fsck, this method no longer seems safe to me, and safely resizing would require booting from a live CD, but still possibly require the use of e2fsck in substitution of fsck used in bcbc's method. I initially tried fsck which didn't work for me, but I was Wubi mounted at the time.

User avatar
elfaure
Level 1
Level 1
Posts: 41
Joined: Tue Jun 18, 2013 10:18 pm

Re: How to Resize Wubi root.disk (Windows Install)

Post by elfaure » Thu Jul 11, 2013 8:45 pm

Just a FYI :!:
I increased the size of the root.disk from 32G to 50G on one of my PCs, and all went well with the resize, but there appears to be some Ubuntu limitation that has been exceeded. I can still login to Mint, but when I choose the Xconf script login option, it fails with a "Ubuntu cannot login" error. But LMDE and Last both work. I don't have remote login setup so I can't check that one. So for all practicle purposes, 32G seems to be the limit if you want *everything* including Xconf script to work. I haven't noticed any other problems thought. 8)

Post Reply

Return to “Installation & Boot”