Overview
BTRFS caused confusion on filesystem usage, particularly with file deletion. The decision was to migrate from BTRFS to EXT4 by copying data to an external drive, wiping the array, recreating it on EXT4, and restoring the data.
Total space reduction: 1.3TB → 890GB
Prerequisites and Preparation
Hardware
- External drive with sufficient space for the data being migrated
- Access to SSH the OpenMediaVault (OMV) server
Pre-migration steps
- Grab an external drive
- Double check there’s no important data on it
- Format the drive to be EXT4
- Turn off the Proxmox (PVE) box
- Turn off autofs on the laptop
Migration Steps
1. Prepare the external drive
Plug the external drive into the NAS and SSH into OMV.
Check what drive it is via:
lsblkMount it:
mount /dev/sdX1 /mnt(Replace sdX1 with the actual device)
2. Copy the shares
Navigate to /export and copy the shares that are needed:
rsync -avzlHP --progress /export/SHARE /mnt/Note: If there’s not enough space, copy only the shares you need. For this migration, everything except PC backups was copied.
3. Flush and unmount
Run sync to flush all write caches:
syncUnmount the drive:
umount /mnt4. Prepare the NAS
Now prepare the NAS for the filesystem migration:
- Delete the NFS shares
- Delete the shared folders
- Delete the RAID 5 array
5. Recreate the storage
- Recreate the RAID 5 array
- Partition EXT4 on the array
- Create the following shares:
ArrrrghISOsLLMsOther_BackupsPBSPC_Backups
Set permissions
File system permissions are set as follows:
Arrrrgh,ISOs, andLLMs: owner:rwx, group:rwx, other:rxOther_Backups,PBS, andPC_Backups: owner:rwx, group:rwx, other:none
6. Configure NFS shares
Create the NFS shares for all file systems with the following settings:
- All set to read-write permission
- All set to listen on
0.0.0.0/1(0.0.0.0/0broke the mount) ISOsandPBShave theno_root_squashflag appended
7. Restore the data
Plug the external drive into the system, SSH into OMV, mount the drive, and copy the files to the correct spot:
rsync -avzlHP --progress /mnt/SHARE/* /export/SHARE/8. Update configuration
Modify the omv.nfs file to point to the new shares.
Post-migration
1. Enable autofs
Turn on autofs.
2. Clean up backups
Delete the auto documents backup service from the laptop, as it’s now pointless without the BTRFS snapshots. The Borg backups can still be used for documents.
3. Restore PC backups
Rerun the PC Borg backup, as it was the one share that wasn’t backed up.
4. Results
The migration resulted in a space reduction from 1.3TB to 890GB.
5. Reboot
Turn on the Proxmox (PVE) box.