How to expand virtualized x86 ROS system partition

Dears,

as ROS is growing and “standard” formely used 60-64MB system partition is not big enough to hold the new packages to make update at once, I have started to search a way how to expand the system partition a bit without loosing the license.

I have spent some hours trying to but I have failed. When touching the virtual drive the license is lost, even if the ROS boots fine after the partition resizing. Unfortunatelly it gets other software ID and previous license file cannot be imported.

Is there any way you have succeeded to enlarge the system partition?

First, you need to use qemu-img to resize the size of the virtual HDD itself. See f.e. this page for full description of the command.

After that, you need to boot from an CD ISO that contains a program for partition resizing.

I’ve heard GParted being mentioned, though I personally prefer Parition Wizard.

Either way, mount this image, boot from it, resize the partition as needed, and when you’re done, un-mount the ISO, and boot “normally”.

But does it keep the old software ID? That’s the important question.

That what I did except I used the vmware tool to expand the disk. Regardless if I enlarge the partition by gparted or not, the software id changed. Does the qemu prevent it from changing?

I don’t know, but my guess would be that for a “normal” x86 image, it won’t preserve the software ID.

For a CHR image… IIRC, it doesn’t matter, since it phones home on a regular basis, and would renew the license.


If you need a lot more space on a “normal” x86 virtual image… You could always add a second HDD, and redirect all files (proxy, hotspot, etc.) to it instead of the main HDD.

I already use secondary disk for these purposes. Unfortunately it is not possible to make standard update as there is no room to fit all downloaded packages to be installed during the next reboot. And it is not possible to redirect the installation source to the second disk.

That’s why I am trying to find a way how to safely expand the boot partition.

Sad you admit that you do not have such experience, just guesses. I had the same idea and I went through it several times unsuccessfully.

So the question is how to preserve software id during the system disk resize operation.

I know that softID depends on disk model and some bytes from beginning of the disk. And my guess is that it might also depend on disk size, because even manual changes to virtual disk without touching partition table or anything, resulted in changed softID.

Worst case, you can upgrade by installing newer RouterOS from CD, that does not change softID and should even keep config.

That’s what I think too.

My actual update procedure is to remove non critical packages, make update and install previously removed packages of the new version back. Sure backuping the entire machine before and having actual ros backup and export is the condition.

Just had this issue. Had just kept the original CHR image size and my dude database filled up all the space.

Tried Partition Wizard, couldn’t resize ext3 partition.

!!!WARNING: Paid Licensing can be affected. See subsequent posts before proceeding.
Here’s the steps I took (running under Hyper-v on Win10 Pro system):
Shut down machine
Increased RAM from 256MB to 1GB
Edit disk | Increased disk to 2GB (from the default 128MB)
Downloaded Ubuntu 16.04 LTS desktop edition
Booted live disk
Ran gparted (nice easy gui)
expanded disk, applied.
Turned off, removed Ubuntu ISO from boot, shrank RAM back down to 256MB, restarted
everything looking good!

HTH someone else out there.
David


Of note: The Dude database was corrupted after the disk space went to 0, it’d run for 30 seconds, and then crash. I’m not sure which step exactly fixed it and got it operational again but in hindsight I’d recommend:

Reboot CHR instance twice
Run from terminal:
/dude vacuum-db
/dude export-db file=name
reboot CHR again
My guess is either during the startup process, or in the vacuum-db it’ll find the truncated database entries and toss them.
Also found that the disk was corrupted, so ran from ubuntu terminal: fsck /dev/sda1


My initial thoughts before learning the above were to try and find the sqlite database in the file structure somewhere and pull it off the Mikrotik and run a database repair from one of the sqlite management suites.

Did a lot of searching trying to find this info and didn’t see it either/not in wiki.
The live Dude database seems to be missing from the Files listing entirely.
From Winbox, the default folder for dude database exports seem to be either the very top (/), or /disk1/rw/disk/

If you had read the previous posts, you would see that they are trying to resize a non-CHR install of RouterOS that had been installed as a virtual guest of some unspecified hypervisor. CHR is licensed differently than standard x86 RouterOS (since it is expected that you will virtualize it!), so your procedure works fine for CHR. But it will not work for standard RouterOS.

Standard x86 RouterOS Soft-ID is generated based on disk specs, seemingly including things like make, model, geometry (and/or LBA count), partition table, and filesystem (although MikroTik understandably has never publicly said specifically how this is generated and what particular components are variables in their algorithm). If you change any of these things, the license is void. Standard x86 (non-Routerboard) RouterOS license is permanently bound to the disk it is installed on, and this is to prevent things like somebody attempting to clone a license and re-use it multiple times on multiple machines. But you can remove the disk from one machine and put it in a newer, beefier machine without risking the license. All components can be changed out except for the disk.

Hey, at least it is less finicky than Windows activation! :slight_smile:

– Nathan

Exactly. Two things above that. You can clone the virtual machine keeping the license (for backup purpose) and you don’t need to expand primary disk just for Dude because you can move easily the dude to whenever additionally attached secondary disk which you can freely resize as you want with no impact on other things. There is only one negative point. The primary disk is always used for vacuum operation so you can never do it successfully if it is not large enough. Hope it will change soon.

Good points (I’ll edit original post with warning about licenses), so far this was all free license stuff. I think the below summarizes accurately?

If it was regular RouterOS with a paid license I’d have lost my license and had to repurchase.
With CHR version it always has a free license so no problem.
With CHR if I’d bought a license I could re-connect to the portal and get it re-issued to the “new” device with no cost.

David