bsd:notes:rsync_nas
This is an old revision of the document!
Table of Contents
TODO
- TODO: UFS
rsync
su -
pkg install 'rsync'
Mount ext4
NAS1= 10TB Mainext4- No partition table (format)
su -
geom disk list
mkdir -p '/mnt/NAS1' && mount -t 'ext2fs' -o 'ro' '/dev/da0' '/mnt/NAS1'
chown -R 'espionage724':'espionage724' '/mnt/NAS1'
Mount NTFS
NAS2= 4TB Backup- NTFS
su -
geom disk list
gpart list 'da1'
pkg install 'fusefs-ntfs'
kldload 'fusefs'
mkdir -p '/mnt/NAS2' && ntfs-3g -o 'rw,big_writes,uid=1001,gid=1001' '/dev/da1p2' '/mnt/NAS2'
Main Sync to Backup
--exclude Videosfor separate drive
rsync --recursive --update --ignore-existing --verbose --debug='ALL' --exclude 'Videos' '/mnt/NAS1/' '/mnt/NAS2'
--checksum
Disconnect Enclosure
Disconnect Backup drive
su -
sync && umount '/mnt/NAS1' '/mnt/NAS2'
kldunload 'fusefs'
usbconfig
usbconfig -d '/dev/ugen0.6' 'power_off'
usbconfig -d '/dev/ugen0.4' 'power_off'
usbconfig -d '/dev/ugen0.5' 'power_off'
Reference
ugen0.4: <USB3.1 Hub VIA Labs, Inc.> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA) ugen0.5: <USB2.0 Hub VIA Labs, Inc.> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA) ugen0.6: <USB 3.1 Device PM ASMedia Technology Inc.> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (0mA)
UFS2 NAS
- 2025/10/24: Linux ext4 → FreeBSD UFS2
- 10TB Main
Format
superfloppypartitionless 1)
su -
geom disk list
dd if='/dev/zero' of='/dev/da0' count='8096'
newfs -L 'NAS' -O '2' -n -o 'time' '/dev/da0'
Disconnect Enclosure
- Reconnect Backup drive
su -
usbconfig
usbconfig -d '/dev/ugen0.6' 'power_off'
usbconfig -d '/dev/ugen0.4' 'power_off'
usbconfig -d '/dev/ugen0.5' 'power_off'
Reference
ugen0.4: <USB3.1 Hub VIA Labs, Inc.> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA) ugen0.5: <USB2.0 Hub VIA Labs, Inc.> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA) ugen0.6: <USB 3.1 Device PM ASMedia Technology Inc.> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (0mA)
Mount
USB Speed
NAS1
NAS1= 10TB Main- UFS2
su -
geom disk list
mkdir -p '/mnt/NAS1' && mount -o 'autoro,noatime' -t 'ufs' -v '/dev/da0' '/mnt/NAS1'
chown -R 'espionage724':'espionage724' '/mnt/NAS1'
NAS2
NAS2= 4TB Backup- NTFS
su -
geom disk list
gpart list 'da1'
pkg install 'fusefs-ntfs'
kldload 'fusefs'
mkdir -p '/mnt/NAS2' && ntfs-3g -o 'rw,big_writes,uid=1001,gid=1001' '/dev/da1p2' '/mnt/NAS2'
4TB Restore
- 4TB HDD restore to 10TB NAS drive
- Exclude
Videos,Games,Music - 2025/10/25:
212G
rsync --recursive --update --ignore-existing --verbose --debug='ALL' --exclude 'Videos' --exclude 'Games' --exclude 'Music' '/mnt/NAS2/' '/mnt/NAS1'
- Games
rsync --recursive --update --ignore-existing --verbose --debug='ALL' '/mnt/NAS2/Games/' '/mnt/NAS/Games'
- Music (
&&withVideosovernight)
rsync --recursive --update --ignore-existing --verbose --debug='ALL' '/mnt/NAS2/Music/' '/mnt/NAS/Music'
- Videos (some)
rsync --recursive --update --ignore-existing --verbose --debug='ALL' '/mnt/NAS2/Videos/' '/mnt/NAS/Videos'
2TB USB Restore
- Videos 2 (WD ext)
rsync --recursive --update --ignore-existing --verbose --debug='ALL' '/run/media/espionage724/688EDD408EDD0808/Dragon Ball DBOX' '/run/media/espionage724/NAS/Videos/Anime'
rsync --recursive --update --ignore-existing --verbose --debug='ALL' '/run/media/espionage724/688EDD408EDD0808/Dragon Ball GT' '/run/media/espionage724/NAS/Videos/Anime'
Maintenance
Repair
sync && udisksctl unmount --block-device '/dev/sda'
sudo e2fsck -D -E 'discard,optimize_extents,inode_count_fullmap,check_encoding,unshare_blocks' -f -v -y '/dev/sda'
Defrag
First-time seemingly takes longer than the whole 5TB+ restore
udisksctl mount --block-device '/dev/sda'
sudo e4defrag -v '/dev/sda' && sync && udisksctl unmount --block-device '/dev/sda'
/srv/www/wiki/data/attic/bsd/notes/rsync_nas.1761367146.txt.gz · Last modified: by Sean Rhone
