FORUMS
Remove All Ads from XDA

Remix OS Player: Increase the size of default 4GB DATA filesystem image

8 posts
Thanks Meter: 3
 
By vlc33, Junior Member on 7th March 2017, 02:06 PM
Post Reply Email Thread
Objective:
- Increase userdata-qemu.img qcow2 compressed (ext4) filesystem image

Prerequisites:
- Remix OS player installed in a Windows machine
- Virtual Box 5.1+ installed with a Linux Virtual Machine (Debian 9)
- Virtual Box guest additions installed (see PD at bottom for how to do it)
- Virtual Box shared folder named Remix_OS.avd to [drive:]\RemixOSPlayer\remixemu\avd\Remix_OS.avd
- Be root ($ su -) or prefix all commands by sudo (if you are in the list)

Procedure:

Install qemu-utils package
Code:
[email protected]:~# apt-get install qemu-utils
Verify you have access to Windows directory containing the compressed disk imagefile to grow
Code:
[email protected]:~# mkdir /tmp/Remix_OS.avd
[email protected]:~#  mount -t vboxsf Remix_OS.avd /tmp/Remix_OS.avd

[email protected]:~# cd /tmp/Remix_OS.avd ; ls
cache.img  config.ini  emulator-user.ini  hardware-qemu.ini  userdata-qemu.img
See what is the actual size of the image (4GB)
Code:
[email protected]:~# qemu-img info userdata-qemu.img
image: userdata-qemu.img
file format: qcow2
virtual size: 3.8G (4089446400 bytes)
disk size: 1.2G
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
Resize the image (just image headers not the file system) (ex. add 4GB more)
Code:
[email protected]:~# qemu-img resize userdata-qemu.img +4G
Image resized.
Verify the new size of the image (8GB)
Code:
[email protected]:~# qemu-img info userdata-qemu.img
image: userdata-qemu.img
file format: qcow2
virtual size: 7.8G (8384413696 bytes)
disk size: 1.2G
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
Mount the image as a 'block device' in Linux (/dev/nbd0)
Code:
[email protected]:~# modprobe nbd max_part=63    <- must do this
[email protected]:~# qemu-nbd -c /dev/nbd0 userdata-qemu.img
Required by resize first do a file system check and say Yes to corrections
Code:
[email protected]:~# e2fsck -f /dev/nbd0
e2fsck 1.42.12 (29-Aug-2014)
Paso 1: Verificando nodos-i, bloques y tamaños
Nodo-i 7, i_size es 163631104, debería ser 167849984.  Arreglar<s>? si
Paso 2: Verificando la estructura del directorio
Paso 3: Revisando la conectividad de directorios
Paso 4: Revisando las cuentas de referencia
Paso 5: Revisando el resumen de información de grupos

data: ***** EL SISTEMA DE FICHEROS FUE MODIFICADO *****
data: 1647/218240 ficheros (9.5% no contiguos), 208042/998400 bloques
Verify size of the file system (4GB = 4K x 998400)
Code:
[email protected]:~# e2fsck -v /dev/nbd0
e2fsck 1.42.12 (29-Aug-2014)
data: limpio, 1647/218240 ficheros, 208042/998400 bloques
Actually resize the file system to occupy all available space (now 8GB)
Code:
[email protected]:~# resize2fs /dev/nbd0
resize2fs 1.42.12 (29-Aug-2014)
Cambiando el tamaño del sistema de ficheros en /dev/nbd0 a 2046976 (4k) bloques.
The filesystem on /dev/nbd0 is now 2046976 (4k) blocks long.
Verify size of the file system (8GB = 4K x 2046976)
Code:
[email protected]:~# e2fsck -v /dev/nbd0
e2fsck 1.42.12 (29-Aug-2014)
data: limpio, 1647/443520 ficheros, 222227/2046976 bloques
Just to re-verify with filesystem tools
Mount the filesystem (of the block device)
Code:
[email protected]:~# mkdir /mnt/mnt
[email protected]:~# mount /dev/nbd0 /mnt/mnt
Print filesystem characteristics
Code:
[email protected]:~# df -h /mnt/mnt
S.ficheros     Tamaño Usados  Disp Uso% Montado en
/dev/nbd0        7,7G   751M  7,0G  10% /mnt/mnt
Unmount file system and block device to free the file
Code:
[email protected]:~# umount /mnt/mnt
[email protected]:~# qemu-nbd -d /dev/nbd0
/dev/nbd0 disconnected
[email protected]:~# umount /tmp/Remix_OS.avd
- - - -
PD: Install VirtualBox Guest Additions in Linux VM

On VBox do Tools | Insert Guest Additions CD Image
Note: in VirtualBox v5.1 and 5.2 there is a link in the download page to get a patched Guest Additions iso images, use it instead of the default one, ther tap the CD icon at the bottom of the virtual machine screen and look for it once downloaded.
Then you find on /media/cdrom0/ the disks content
Usually cannot run direcly VBoxLinuxAdditions.run because automatic mount for user cdrom image does not allow file execution.
So you have to copy the file VBoxLinuxAdditions.run to /tmp for example:

#Install first the prerequisites for Guest Additions
Code:
$ su -
# apt-get install build-essential module-assistant
# m-a prepare
Code:
# cp /media/cdrom0/VBoxLinuxAdditions.run /tmp
# cd /tmp
# chmod 755 VBoxLinuxAdditions.run
# ./VBoxLinuxAdditions.run

Verifying archive integrity... All good.
Uncompressing VirtualBox 5.1.14 Guest Additions for Linux...........
VirtualBox Guest Additions installer
Removing installed version 5.1.12 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
vboxadd.sh: Building Guest Additions kernel modules.
vboxadd.sh: You should restart your guest to make sure the new modules are actually used.
vboxadd.sh: Starting the VirtualBox Guest Additions

You may need to restart the Window System (or just restart the guest system)
to enable the Guest Additions.

# reboot
The Following 2 Users Say Thank You to vlc33 For This Useful Post: [ View ] Gift vlc33 Ad-Free
 
 
16th March 2017, 08:50 PM |#2  
Junior Member
SchwarzWald -its wood, not city
Thanks Meter: 1
 
More
96% of PC users has Windows..
20th April 2017, 02:53 PM |#3  
Junior Member
Flag Raamsdonksveer, The Netherlands
Thanks Meter: 1
 
More
Hi ,

I'm pretty new to all this but have managed to resize the "userdata-qemu.img" file with the qemu-img command included in one of the sub-folders of RemixOS player.

I'm not using virtualbox, and was wondering if it would be possible to do the same with just windows 10.

The commands "e2fsk" and "resize2fs" are also available in one of he subfolders that come with RemixOS player. So i should be able to execute those as well.

My only problem would be: How i mount the "userdata-qemu.img" file as a block device in windows 10. So that i can execute the required commands to do the rest of this.

Thanks in advance,
The Following User Says Thank You to Shinzok For This Useful Post: [ View ] Gift Shinzok Ad-Free
20th April 2017, 04:29 PM |#4  
vlc33's Avatar
OP Junior Member
Thanks Meter: 3
 
Donate to Me
More
Quote:
Originally Posted by Shinzok

Hi ,
(...)
My only problem would be: How i mount the "userdata-qemu.img" file as a block device in windows 10. So that i can execute the required commands to do the rest of this.

Thanks in advance,

Thank You, I wrote this article because I did not know how to do the job 'in windows', I did not even know there was e2fsck and resize2fs already in tools directory.

Nevertheless, you will also need also a qcow2 image mounter for windows

Quote:

Mount the image as a 'block device' in Linux (/dev/nbd0)
[email protected]:~# modprobe nbd max_part=63 <- must do this
[email protected]:~# qemu-nbd -c /dev/nbd0 /mnt/vboxsf/userdata-qemu.img

I'd like to state that this proposed solution was already done 'under Windows'
.. with VirtualBox & Linux
The Following User Says Thank You to vlc33 For This Useful Post: [ View ] Gift vlc33 Ad-Free
20th April 2017, 06:07 PM |#5  
Junior Member
Flag Raamsdonksveer, The Netherlands
Thanks Meter: 1
 
More
ah ok, thank, will try to get linux working in virtualbox.

Ok, got it working.
9th June 2017, 08:28 AM |#6  
Junior Member
Thanks Meter: 0
 
More
The tools you mentioned were intended for cygwin
Quote:
Originally Posted by Shinzok

Hi ,

I'm pretty new to all this but have managed to resize the "userdata-qemu.img" file with the qemu-img command included in one of the sub-folders of RemixOS player.

I'm not using virtualbox, and was wondering if it would be possible to do the same with just windows 10.

The commands "e2fsk" and "resize2fs" are also available in one of he subfolders that come with RemixOS player. So i should be able to execute those as well.

My only problem would be: How i mount the "userdata-qemu.img" file as a block device in windows 10. So that i can execute the required commands to do the rest of this.

Thanks in advance,

I believe the tools you mentioned were intended to run under windows using cygwin. In the remix\RemixOSPlayer\remixemu\tools\bin subdirectory there are a number of cyg*.dll files i.e. cygwin1.dll along with e2fsck.exe, resize2fs.exe, tune2fs.exe. I didn't know they were there until I read your post. I haven't tried it this way yet. I had forgotten that I had and old installation of vbox on my laptop with linux on it so I may just go that route. But it does look like it should work fine just using windows and cygwin. Too late for you I guess but I thought I would put it out there in case someone else is wondering the same thing.
9th June 2017, 09:23 AM |#7  
vlc33's Avatar
OP Junior Member
Thanks Meter: 3
 
Donate to Me
More
I do not know if the tools directory is for cywin.
The point is that you need to mount the resized qcow2 and resize2fs it, so this can not be be done only with windows, you will need a Linux under Windows to do it.
As there is probably a cywin way, I do prefer Virtual Box+Linux way, either case both are not the solution but the tool to provide it.
17th September 2017, 05:33 AM |#8  
Member
Thanks Meter: 14
 
More
Thanks a lot for the instruction.
I followed the steps on an Ubuntu running in VirtualBox.
It works perfectly. Now I have 16GB in my Remix OS player disk image.
The Following User Says Thank You to hevangel For This Useful Post: [ View ] Gift hevangel Ad-Free
25th March 2018, 05:30 AM |#9  
Junior Member
Thanks Meter: 1
 
More
I did added 4G first to test then 30G it works perfectly
thanks for the tutorial!
The Following User Says Thank You to ClemCa For This Useful Post: [ View ] Gift ClemCa Ad-Free
13th November 2018, 04:45 AM |#10  
Junior Member
Thanks Meter: 2
 
More
how to do it directly
Sistem that i use: Windows 10

Do this before first run:

Suppose you want to resize to 32GB and the folder that RemixOSplayer installed is D:\Programs\RemixOSPlayer:

Code:
D:\Programs\RemixOSPlayer\remixemu\qemu-img> .\qemu-img resize D:\Programs\RemixOSPlayer\remixemu\system-images\userdata-qemu.img 32000M
Use this command to verify the size, note the "virtual size":

Code:
D:\Programs\RemixOSPlayer\remixemu\qemu-img> .\qemu-img info D:\Programs\RemixOSPlayer\remixemu\system-images\userdata-qemu.img

change the RemixOSPlayer folder with your own installation
13th November 2018, 08:01 AM |#11  
vlc33's Avatar
OP Junior Member
Thanks Meter: 3
 
Donate to Me
More
Sorry but it is not that simple.
Quote:
Originally Posted by diorz38

Sistem that i use: Windows 10

Do this before first run:

Suppose you want to resize to 32GB and the folder that RemixOSplayer installed is D:\Programs\RemixOSPlayer:

Code:
D:\Programs\RemixOSPlayer\remixemu\qemu-img> .\qemu-img resize D:\Programs\RemixOSPlayer\remixemu\system-images\userdata-qemu.img 32000M
Use this command to verify the size, note the "virtual size":

Code:
D:\Programs\RemixOSPlayer\remixemu\qemu-img> .\qemu-img info D:\Programs\RemixOSPlayer\remixemu\system-images\userdata-qemu.img

change the RemixOSPlayer folder with your own installation

Hello, in fact this proposed single step is one of the firsts that appear in the tutorial, the question is if after doing only this step, the recognized size of the file system matches the 'virtual disk' new size, the answer is no it does not work that simple, that is why I elaborate this more complex procedure.
Verify it by yourself and test if your upgraded machine has those 32Gb, the answer will be no, it will remain with 4Gb.
That is because You have to expand the filesystem to match the new virtual 'fisical' new disk size.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes