Community discussions

MikroTik App
 
jarda
Forum Guru
Forum Guru
Topic Author
Posts: 7603
Joined: Mon Oct 22, 2012 4:46 pm

How to expand virtualized x86 ROS system partition

Wed Jan 27, 2016 4:41 pm

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?
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2411
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: How to expand virtualized x86 ROS system partition

Wed Jan 27, 2016 5:44 pm

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".
PEAR2_Net_RouterOS(1.0.0b6) - My API client in PHP
(Rate my posts? If you want... no pressure...)
 
Sob
Forum Guru
Forum Guru
Posts: 5594
Joined: Mon Apr 20, 2009 9:11 pm

Re: How to expand virtualized x86 ROS system partition

Wed Jan 27, 2016 5:56 pm

But does it keep the old software ID? That's the important question.
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply. Not intended as incentive for masochists.
 
jarda
Forum Guru
Forum Guru
Topic Author
Posts: 7603
Joined: Mon Oct 22, 2012 4:46 pm

Wed Jan 27, 2016 5:59 pm

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?
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2411
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: How to expand virtualized x86 ROS system partition

Wed Jan 27, 2016 6:04 pm

But does it keep the old software ID? That's the important question.
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.
PEAR2_Net_RouterOS(1.0.0b6) - My API client in PHP
(Rate my posts? If you want... no pressure...)
 
jarda
Forum Guru
Forum Guru
Topic Author
Posts: 7603
Joined: Mon Oct 22, 2012 4:46 pm

Wed Jan 27, 2016 7:33 pm

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.
 
Sob
Forum Guru
Forum Guru
Posts: 5594
Joined: Mon Apr 20, 2009 9:11 pm

Re: How to expand virtualized x86 ROS system partition

Thu Jan 28, 2016 4:30 am

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.
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply. Not intended as incentive for masochists.
 
jarda
Forum Guru
Forum Guru
Topic Author
Posts: 7603
Joined: Mon Oct 22, 2012 4:46 pm

Thu Jan 28, 2016 8:49 am

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.
 
silversword
newbie
Posts: 43
Joined: Tue Jul 23, 2013 3:36 pm

Re: How to expand virtualized x86 ROS system partition

Wed May 11, 2016 4:36 pm

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/
Last edited by silversword on Fri May 13, 2016 3:16 pm, edited 3 times in total.
 
User avatar
NathanA
Forum Veteran
Forum Veteran
Posts: 801
Joined: Tue Aug 03, 2004 9:01 am

Re: How to expand virtualized x86 ROS system partition

Wed May 11, 2016 5:00 pm

Just had this issue. Had just kept the original CHR image size and my dude database filled up all the space.
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! :)

-- Nathan
 
jarda
Forum Guru
Forum Guru
Topic Author
Posts: 7603
Joined: Mon Oct 22, 2012 4:46 pm

Wed May 11, 2016 5:13 pm

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.
 
silversword
newbie
Posts: 43
Joined: Tue Jul 23, 2013 3:36 pm

Re: How to expand virtualized x86 ROS system partition

Wed May 11, 2016 9:00 pm

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

Who is online

Users browsing this forum: No registered users and 3 guests