Power off SecureOffice, physically install the new disk (mSATA, SATA) and boot SecureOffice.
It is assumed you are at a Linux command prompt on SecureOffice, either directly or using PuTTY.
During boot, Linux enumerates block devices (disks) and assigns them names: "sda, sdb, sdc", etc. The Linux device name of the new disk needs to be identified.
Enter "dmesg | grep sdX" repeatedly, where X increments from "b", "c", "d", etc. until you identify the correct disk.
You are looking for a portion of output (from dmesg) of the following form, corresponding to the new disk, where XXX is the disk size in GB:
"sd 2:0:0:0: [sdb] 976773168 512-byte logical blocks: (XXX GB/YYY GiB)"
If the size of the new disk is unique (only one on installation system with XXX equal to the new disk size), this is likely the correct disk (sdb, sdc, etc). Note that "sda" cannot be the correct disk, since that contains the OS of SecureOffice.
As a sanity check, to confirm the new disk candidate is correct, the disk partitions can be inspected using the "fdisk" command.
Enter "fdisk /dev/disk" where "disk" is the candidate identified above (sdb, sdc, etc).
If still uncertain regarding correct disk choice (candidate disk has partitions you are unsure of), another sanity check is to inspect the disk contents.
The disk identified will be re-partitioned and formatted in the next step, wiping out all data on the chosen disk. Be absolutely certain the disk chosen is the correct disk. Otherwise, at best, you will lose all data on the disk, at worse, wipe out the SecureOffice operating system. Recovery from this disaster is left as an exercise for the reader.
It is assumed that the new disk will contain data such as virtual machines, fileserver files such as media or documents. One partition is sufficient for this. Any existing partitions will be deleted. If multiple partitions or using an existing partition is desired, Google is your friend. Using a SecureOffice command prompt:
The new disk needs a mountpoint (directory) on the SecureOffice filesystem, which must be created. It is assumed that you want this disk to be mounted automatically at boot. These instructions assume you want to mount the new disk at "/home/NewDisk". Feel free to change the path to suit your tastes.
enter "mkdir -p "/home/NewDisk" to create the mount point.
enter "blkid" to determine the UUID corresponding to your new disk. You will see a response similar to: "/dev/sdX1: UUID="5ec55ff2-6e79-46ea-9228-36e0dc11a88f" TYPE="ext4" PARTUUID="63ef2a2c-01"", where sdX1 corresponds to the new disk. The UUID will be used for automatic mounting (at boot) of your new disk by adding an entry in the "/etc/config/fstab" file.
enter "nano /etc/config/fstab" and add an entry at the end for your new disk, like the figure below.
config global automount
option from_fstab '1'
option anon_mount '1'
option delay_root '5'
option check_fs '1'
config global autoswap
option from_fstab '1'
option anon_swap '0'
option uuid '8a779204-4d4f-45cc-8564-9ff0670209ff'
option enabled '1'
option target '/home/data'
option options 'rw'
option uuid 'ea4f8d78-96b3-4fa8-b051-54abe4f5c91b'
option target '/home/NewDisk'
option options 'rw'
option uuid '5ec55ff2-6e79-46ea-9228-36e0dc11a88f'
Figure 1: Add Mount Entry for Disk
The last entry above defines the mount point and UUID determined above. Exit the nano editor.
enter "block mount" to mount your new disk at "/home/NewDisk"
This achieves the following objectives:
There are two options for replacing the system disk:
To copy SecureOffice to a new disk:
To copy entire disk (full disk replacement):
To copy only system partitions (to have a backup boot, or save time by not copying larger data partition):
If the replacement disk is not the same size as the existing disk, the new disk data partition size is incorrect (because the partition layout was copied) and needs to be adjusted:
Power down SecureOffice, remove the old system disk, power on. It may be necessary to reconfigure the boot device if boot fails.
Note: replacing the system disk constitutes a hardware change and trial licensing (cannot change hardware) will fail. Fully (paid) licenses can be refreshed (System->Licensing->Manage Licenses), enter "Register", "Install" for each licensed product.
Once you are satisfied with SecureOffice installed packages and configuration, it is prudent to keep regular backups for disaster recovery and system upgrade purposes.
It is not yet possible to update SecureOffice (Flash new firmware) using Backup/Restore. The current way to upgrade SecureOffice is to backup the existing system, re-install SecureOffice and restore from backup.
SecureOffice uses a modified (from original OpenWrt) backup / restore script which restores all settings, including databases from all (including securepbx, vmplayer, zoneminder, nxserver, home-assistant) installed applications. If any of the packages in the previous list were installed at backup, they will be re-installed upon restore.
During restore, it is possible to automatically install other packages if they have been specified as "EXTRA_PACKAGES" in the "/sbin/backup.sh" backup/restore script. This means, if you want extra packages to be re-installed at restore, every time you install a package, add it to "EXTRA_PACKAGES" in the backup/restore script.
SecureOffice backup / restore is (Luci GUI) accessed at the (System->Backup / Flash Firmware) menu, as shown below.
Figure 2: OpenWrt Backup
To perform a backup, select "Generate Archive". You will be prompted for a location (on your PC) to save the backup archive. Select a directory location. Backup is done.
Prior to restoring, insure that any extra packages to install are specified as "EXTRA_PACKAGES" in the "/sbin/backup.sh" backup/restore script.
To perform a restore, select "Browse". Select the file (on your PC) containing a previous backup. Select "Upload Archive". During restore, Status is displayed. When status becomes "Restore Complete", then "Idle", a manual reboot is necessary to incorporate any config changes.
If, after some time (may take a while for package installation), status is not "Restore Complete", then "Idle", something has failed. Examine "/var/log/backup.log" to fix any issues.