Add Data Disk¶
mFusion, HSG and mlog appliances keep their growing data on the system disk by default, where the data partition is small: the MySQL database (monitoring history, syslog, RADIUS accounting) and the mbox data folder (configuration backups, reports, firmware images, log archives). When this data grows, add a second, larger disk and move the data onto it. This guide explains how to prepare the disk, mount it, and move the data onto it with the disk show, disk create, disk mount and disk data commands.
Note
disk data replaces the older data-path command under mfusion mysql-server. See Upgrading from data-path if your appliance used it.
Overview¶
Adding a data disk takes four commands, run in enable mode:
| Step | Command | What it does |
|---|---|---|
| 1. Find the disk | disk show |
Lists the disks and partitions, and shows where the MySQL and mbox data are stored |
| 2. Prepare the disk | disk create <disk> |
Creates one partition over the whole disk and formats it (ext4) |
| 3. Mount the disk | disk mount <folder> <partition> |
Mounts the partition on a folder, permanently (survives reboots) |
| 4. Move the data | disk data <folder> |
Moves the MySQL database and the mbox data folder onto the mounted disk |
After step 3 the disk can also hold other large data, such as NetFlow collector files. Step 4 is what moves the database and the mbox data.
Both keep their usual locations, so MySQL settings, the GUI, backups, restores and HA sync work the same as before. disk data copies each to the new disk and mounts that copy in its place:
| Data | Usual location | Stored on the data disk at |
|---|---|---|
| MySQL database | /var/lib/mysql |
<folder>/mysql |
| mbox data (backups, reports, firmware images, archives) | /var/mboxdata |
<folder>/mboxdata |
The setting belongs to the appliance's hardware, not to its configuration: it is not saved in the startup configuration. Restoring a configuration backup onto another appliance therefore never tries to move its data to a disk that appliance may not have.
Use Cases¶
- Growing monitoring history: an mFusion appliance monitoring thousands of devices, where the monitoring history no longer fits the system disk.
- Log collector: an mlog or HSG appliance receiving syslog from many devices.
- Hotspot accounting: an HSG appliance keeping months of RADIUS session and usage records.
- Virtual appliances: adding a second virtual disk to an appliance running on VMware, Proxmox or a cloud platform.
Requirements¶
| Requirement | Details |
|---|---|
| Appliance | mFusion, HSG or mlog on Debian 10 or later, running a firmware release later than 20261028-2330 |
| Disk | A second, empty disk, larger than the current database and mbox data plus room to grow. All data on it is erased in step 2 |
| Free space | The new disk needs room for the current database and mbox data plus 10% and 1 GB |
| Maintenance window | MySQL, the GUI and the services that use them (monitoring, RADIUS) are stopped while the data is copied, typically 1–2 minutes per 3 GB |
| Access | CLI access in enable mode (console or SSH) |
Step 1: Add the Disk and Find It¶
Attach the new disk to the appliance: install the drive, or add a virtual disk in the hypervisor or cloud console. Then list the disks:
The new disk appears with its size and no partitions. In this example it is /dev/sdb, 500 GiB:
Disk /dev/sda: 120 GiB, 128849018880 bytes, 251658240 sectors
...
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 976895 974848 476M 83 Linux
/dev/sda2 976896 32227327 31250432 14.9G 83 Linux
/dev/sda3 32227328 40228863 8001536 3.8G 82 Linux swap / Solaris
/dev/sda4 40228864 251656191 211427328 100.8G 83 Linux
Disk /dev/sdb: 500 GiB, 536870912000 bytes, 1048576000 sectors
...
MySQL data: /var/lib/mysql (system disk)
mbox data: /var/mboxdata (system disk)
my.cnf: datadir=/var/lib/mysql
Filesystem Size Used Avail Use% Mounted on
/dev/sda4 99G 12G 82G 13% /var
The last lines show where the MySQL and mbox data are stored now: on the system disk.
Warning
Make sure you pick the new, empty disk. /dev/sda is the system disk. disk create refuses to touch the system disk, but it erases any other disk you name.
Step 2: Prepare the Disk¶
Create one partition over the whole disk and format it:
mfusion# disk create /dev/sdb
all data on disk /dev/sdb will be lost. do you want to continue "y" or "n": y
...
[info] you can now map /dev/sdb1 to a folder.
The partition is /dev/sdb1. On NVMe and eMMC disks the partition name has a p, for example /dev/nvme1n1p1.
Skip this step if the disk already has an ext4 partition you want to use.
Step 3: Mount the Disk¶
Mount the partition on a folder. /data is the usual choice:
mfusion# disk mount /data /dev/sdb1
[info] creating a new folder /data
[info] mounting /data to /dev/sdb1...
[info] /data is mounted to /dev/sdb1 successfully.
[info] task executed successfully.
The mount is saved and comes back after every reboot. If the disk ever fails or is removed, the appliance still boots normally and stays reachable remotely; whatever stores data on the disk stops until the disk is back.
Only ext4 partitions are accepted.
Step 4: Move the Data¶
Move the MySQL database and the mbox data onto the mounted disk:
mfusion# disk data /data
MySQL, the GUI and the services using them will be stopped while 2780MB of MySQL and mbox data is copied to /data. continue? "y" or "n": y
...
[info] copying /var/lib/mysql to /data/mysql...
[info] copying /var/mboxdata to /data/mboxdata...
...
[info] /var/lib/mysql is now on /data/mysql.
[info] removed /var/lib/mysql.pre-datadisk-20261030-181111
[info] /var/mboxdata is now on /data/mboxdata.
[info] removed /var/mboxdata.pre-datadisk-20261030-181111
[info] task executed successfully.
disk data:
- Checks that
/datais a separately mounted disk and has enough free space for both. - Stops MySQL, the GUI and the services that use them.
- Copies the database to
/data/mysqland the mbox data to/data/mboxdata, and verifies both copies. - Mounts them in place of
/var/lib/mysqland/var/mboxdataand starts the services again. - Checks that the same files and the same databases and tables are served as before, then deletes the old copies from the system disk.
If any check fails, the appliance is rolled back to the data on the system disk and the copies on /data are left for inspection. If one of the two is already on /data (for example after an upgrade), only the other one is moved.
Note
Nothing can be written to the system disk in place of the data disk. While the data disk is missing, MySQL does not start and writes to the mbox data folder fail. This is deliberate: it prevents new data from collecting on the small system disk and being hidden again once the disk is back. Restore or reconnect the disk and everything starts normally again.
Verification¶
| Items to Test | Command | Expected Outcome |
|---|---|---|
| Data is on the new disk | disk show |
MySQL data and mbox data both show -> /data/... (data disk, mounted) |
| Disk usage | disk show |
The filesystem lines for /var/lib/mysql and /var/mboxdata show /dev/sdb1 with the new disk's size |
| GUI | Log in to the GUI and open Admin → General → Backup & Restore | The page opens and lists the existing backups |
| MySQL is running | show mfusion mysql |
MySQL is active |
| Services are back | show mfusion server / show security radius-server (as installed) |
Each service shows running |
| Survives a reboot | reboot, then disk show |
Both still (data disk, mounted), MySQL running |
Example disk show ending after step 4:
MySQL data: /var/lib/mysql -> /data/mysql (data disk, mounted)
mbox data: /var/mboxdata -> /data/mboxdata (data disk, mounted)
my.cnf: datadir=/var/lib/mysql
Filesystem Size Used Avail Use% Mounted on
/dev/sda4 99G 9.1G 85G 10% /var
/dev/sdb1 492G 2.8G 464G 1% /var/lib/mysql
/dev/sdb1 492G 2.8G 464G 1% /var/mboxdata
Moving the Database Back¶
To move the data back to the system disk, for example before removing or replacing the data disk:
mfusion# no disk data
MySQL, the GUI and the services using them will be stopped while 2780MB of MySQL and mbox data is copied back to the system disk. continue? "y" or "n": y
...
[info] /var/lib/mysql is back on the system disk.
[info] removed /data/mysql
[info] /var/mboxdata is back on the system disk.
[info] removed /data/mboxdata
[info] task executed successfully.
The system disk must have enough free space for the data. The disk itself stays mounted on /data.
HA Pairs¶
On an HA pair (mfusion sync), each appliance has its own disks, so run the steps on each appliance. The disk layouts do not need to match: HA sync copies the database through MySQL and the mbox data by file sync into /var/mboxdata, wherever each appliance stores it.
- Do the secondary first. Replication pauses while its MySQL is stopped and catches up when it starts again.
- Then do the primary in a maintenance window, or fail over first so the appliance you work on is the secondary.
- Check
show mfusion syncon both appliances: replication running, no replication error, the secondary read-only.
An HA rejoin (mfusion sync rejoin) also works on an appliance with a data disk. It keeps its temporary copy of the old database on the data disk and removes it once the rejoin succeeds.
Upgrading from data-path¶
Older firmware moved the database with data-path under mfusion mysql-server:
Some appliances also had /var/mboxdata replaced by hand with a symbolic link to a folder on the data disk.
When such an appliance is upgraded, the upgrade converts it to the disk data setup automatically. Nothing needs to be done:
- The database and the mbox data stay where they are (for example
/data/mysqland/data/mboxdata). Nothing is copied. - The symbolic link is replaced by the
disk datamount of the same folder. - The stale database copy left on the system disk when
data-pathwas first set is deleted. - The
data-pathline is removed from the startup configuration.
After the upgrade, data-path is no longer saved. A data-path line in an older configuration or backup is accepted and ignored, with a reminder to use disk data. Use disk show to check where the data is.
Troubleshooting¶
| Symptom | Likely Cause | Solution |
|---|---|---|
<folder> is not a mounted disk - use "disk mount" first. |
The folder is not a mount point | Run step 2 and step 3 first |
<folder> is on the system disk - choose a separately mounted disk. |
The folder is on the system disk, for example /var |
Mount the new disk on its own folder (step 3) |
not enough space on <folder> |
The disk is smaller than the database and mbox data plus headroom | Use a larger disk, or reduce data retention first |
<folder>/mysql already exists and is not empty |
Data from an earlier attempt or another appliance | Move or delete that folder after checking its contents, then retry |
(data disk NOT mounted - disk missing?), MySQL not running, the GUI cannot save files |
The data disk failed, was detached or was not attached to the virtual machine | Reattach the disk and reboot, or run disk mount again; MySQL and the GUI work normally once the disk is back |
<path> is on <folder> - run "no disk data" first. |
The data is already on another data disk | Move it back with no disk data, then run disk data with the new folder |
<path> is a link to <folder> - the upgrade converts it. |
/var/mboxdata is a hand-made symbolic link |
Upgrade the appliance; the upgrade converts the link |
<partition> is formatted as "<type>", not ext4. Refusing to mount. |
The partition has another file system | Run disk create on the disk to reformat it (erases it) |
data-path is no longer used warning |
An older configuration still contains data-path |
No action needed; use disk data for new setups |
Best Practices¶
- Size for growth: choose a disk several times larger than today's database and mbox data. Monitoring history, syslog and backups grow with every device added.
- Use one data disk: keep the database, the mbox data and NetFlow files on the same mounted data disk, and keep an eye on its usage with
disk show. The appliance's daily disk check follows the data disk automatically, and shortens database retention when the disk holding the database is more than 90% full. - Plan a maintenance window: MySQL, the GUI and the services that use them stop while the data is copied.
- Back up first: take a configuration and database backup (Admin → General → Backup & Restore) before moving the data.
- Monitor the disk: a failing data disk stops MySQL. Check its usage and health regularly, and replace it before it fills up.
- Protect the console:
disk createerases disks. Limit CLI enable-mode access to administrators.
Related Features¶
- Log Server — syslog collection, which stores its logs in MySQL
- Backward Compatibility — upgrading older appliances