Skip to content

Instantly share code, notes, and snippets.

@darth-veitcher
Last active June 20, 2016 16:21
Show Gist options
  • Save darth-veitcher/85c27c838df0f0c8bbadd2df8750d0bd to your computer and use it in GitHub Desktop.
Save darth-veitcher/85c27c838df0f0c8bbadd2df8750d0bd to your computer and use it in GitHub Desktop.
Creating and using portable (ext2) standalone backup discs with FreeNAS

Requirements:

  • stick a single 3.5" hdd into an external dock (usb) and be able to copy files to it
  • disc should be ext2 formatted so it can be transferred between devices (as opposed to tied to ZFS / UFS)
  • commands should all be run from FreeNAS shell (i.e. no external dependencies)

Partition and fix drive

Use these commands if you need to format the drive / change partitions.

Partition

gpart create -s gpt da8
gpart add -t mbr da8

Format

mke2fs /dev/da8p1
...
mke2fs 1.42.10 (18-May-2014)
Creating filesystem with 122096637 4k blocks and 30531584 inodes
Filesystem UUID: 5b4702a2-ec1b-478a-9f4d-449df7ed19ac
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000

Allocating group tables: done                            
Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done    

Mount & Backup

# Mount the created partition
mount -t ext2fs /dev/da8p1 /mnt/external_usb/

# Copy something across
rsync -rLvP TVShow.Name /mnt/external_usb/
...
sending incremental file list
TVShow.Name/
TVShow.Name/TVShow.Name.Season.01/
TVShow.Name/TVShow.Name.Season.01/TVShow.Name.S01E01.Pilot.WEBRip.1080p.x264.AC3.6ch.mkv
    205,881,344   5%   30.83MB/s    0:01:47

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment