Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dteske@scribe12 secure_thumb $ make
- dd if=/dev/zero of=secure_thumb.md bs=1m seek=256 count=0
- 0+0 records in
- 0+0 records out
- 0 bytes transferred in 0.000116 secs (0 bytes/sec)
- sudo mdconfig -f secure_thumb.md
- [sudo] Password:
- md0
- sudo gpart create -s MBR md0
- md0 created
- sudo gpart add -t freebsd -i 1 md0
- md0s1 added
- sudo gpart create -s BSD md0s1
- md0s1 created
- sudo gpart add -t freebsd-ufs -i 1 -s 128m md0s1
- md0s1a added
- sudo gpart add -t freebsd-ufs -i 4 -s 16m md0s1
- md0s1d added
- sudo gpart add -t freebsd-ufs -i 5 md0s1
- md0s1e added
- sudo newfs -n -U -O 1 -f 512 -b 4096 -i 8192 md0s1a
- /dev/md0s1a: 128.0MB (262144 sectors) block size 4096, fragment size 512
- using 11 cylinder groups of 12.64MB, 3237 blks, 1632 inodes.
- with soft updates
- super-block backups (for fsck_ffs -b #) at:
- 32, 25928, 51824, 77720, 103616, 129512, 155408, 181304, 207200, 233096, 258992
- mkdir -p mnt
- sudo mount /dev/md0s1a mnt
- sudo mkdir -m 0700 -p mnt/geli
- Enter new passphrase:
- Reenter new passphrase:
- sudo uuidgen -o mnt/.uuid
- sudo chmod 444 mnt/.uuid
- sudo chflags schg mnt/.uuid
- cat mnt/.uuid
- b0db8654-b5c9-11e9-96d6-000c293d4728
- mkdir -m 0700 -p geli
- sudo dd if=/dev/random of=mnt/geli/ffthumb-s1d.key bs=1k count=512
- 512+0 records in
- 512+0 records out
- 524288 bytes transferred in 0.005826 secs (89996172 bytes/sec)
- dd if=/dev/random of=geli/ffhost-b0db8654-b5c9-11e9-96d6-000c293d4728-s1d.key bs=1k count=512
- 512+0 records in
- 512+0 records out
- 524288 bytes transferred in 0.004657 secs (112592043 bytes/sec)
- sudo chmod 400 mnt/geli/ffthumb-s1d.key
- sudo chflags schg mnt/geli/ffthumb-s1d.key
- chmod 400 geli/ffhost-b0db8654-b5c9-11e9-96d6-000c293d4728-s1d.key
- sudo geli init -J- -B mnt/geli/ffthumb-s1d.backup -K mnt/geli/ffthumb-s1d.key -K geli/ffhost-b0db8654-b5c9-11e9-96d6-000c293d4728-s1d.key md0s1d
- Metadata backup for provider md0s1d can be found in mnt/geli/ffthumb-s1d.backup
- and can be restored with the following command:
- # geli restore mnt/geli/ffthumb-s1d.backup md0s1d
- sudo geli attach -j- -k mnt/geli/ffthumb-s1d.key -k geli/ffhost-b0db8654-b5c9-11e9-96d6-000c293d4728-s1d.key md0s1d
- sudo newfs -n -U -O 1 -f 512 -b 4096 -i 8192 md0s1d.eli
- /dev/md0s1d.eli: 16.0MB (32767 sectors) block size 4096, fragment size 512
- using 4 cylinder groups of 4.00MB, 1024 blks, 512 inodes.
- with soft updates
- super-block backups (for fsck_ffs -b #) at:
- 32, 8224, 16416, 24608
- sudo dd if=/dev/random of=mnt/geli/ffthumb-s1e.key bs=1k count=512
- 512+0 records in
- 512+0 records out
- 524288 bytes transferred in 0.004335 secs (120945561 bytes/sec)
- dd if=/dev/random of=geli/ffhost-b0db8654-b5c9-11e9-96d6-000c293d4728-s1e.key bs=1k count=512
- 512+0 records in
- 512+0 records out
- 524288 bytes transferred in 0.005837 secs (89827101 bytes/sec)
- sudo chmod 400 mnt/geli/ffthumb-s1e.key
- sudo chflags schg mnt/geli/ffthumb-s1e.key
- chmod 400 geli/ffhost-b0db8654-b5c9-11e9-96d6-000c293d4728-s1e.key
- sudo geli init -J- -B mnt/geli/ffthumb-s1e.backup -K mnt/geli/ffthumb-s1e.key -K geli/ffhost-b0db8654-b5c9-11e9-96d6-000c293d4728-s1e.key md0s1e
- Metadata backup for provider md0s1e can be found in mnt/geli/ffthumb-s1e.backup
- and can be restored with the following command:
- # geli restore mnt/geli/ffthumb-s1e.backup md0s1e
- sudo geli attach -j- -k mnt/geli/ffthumb-s1e.key -k geli/ffhost-b0db8654-b5c9-11e9-96d6-000c293d4728-s1e.key md0s1e
- sudo newfs -n -U -O 1 -f 512 -b 4096 -i 8192 md0s1e.eli
- /dev/md0s1e.eli: 112.0MB (229366 sectors) block size 4096, fragment size 512
- using 9 cylinder groups of 12.64MB, 3237 blks, 1632 inodes.
- with soft updates
- super-block backups (for fsck_ffs -b #) at:
- 32, 25928, 51824, 77720, 103616, 129512, 155408, 181304, 207200
- sudo mkdir -m 0700 -p mnt/keys
- sudo mount /dev/md0s1d.eli mnt/keys
- sudo mkdir -m 0700 -p mnt/encstore
- type rsync
- sudo rsync -avSH src/ mnt/
- sending incremental file list
- ./
- mount.sh
- umount.sh
- keys/
- keys/Makefile
- sent 9,549 bytes received 88 bytes 19,274.00 bytes/sec
- total size is 9,248 speedup is 0.96
- sudo chmod 555 mnt/mount.sh mnt/umount.sh
- sudo chflags schg mnt/mount.sh mnt/umount.sh
- sudo umount mnt/keys
- sudo geli detach md0s1e
- sudo geli detach md0s1d
- sudo umount mnt
- rmdir mnt
- sudo mdconfig -d -u 0
- dteske@scribe12 secure_thumb $ make status
- secure_thumb.md is not attached
- secure_thumb.md is not mounted
- dteske@scribe12 secure_thumb $ make open
- sudo mdconfig -lf secure_thumb.md
- sudo mdconfig -f secure_thumb.md
- md0
- secure_thumb.md successfully attached to md0
- sudo mdconfig -lf secure_thumb.md
- md0
- mkdir -p mnt
- df -nh mnt
- Filesystem Size Used Avail Capacity Mounted on
- /dev/gpt/rootfs 29G 6.8G 20G 25% /
- awk -v dev=/dev/md0s1a '$1=="/dev/md0s1a"{exit s=1}END{exit !s}'
- df -nh .
- awk 'NR>1{print $1;exit s=1}END{exit !s}'
- df -nh mnt
- awk 'NR>1{print $1;exit s=1}END{exit !s}'
- sudo mount /dev/md0s1a mnt
- secure_thumb.md successfully mounted on mnt
- GELI_HOST_KEY_DIR=./geli sh mnt/mount.sh -d
- [GELI] Passphrase:
- Name Status Components
- md0s1d.eli ACTIVE md0s1d
- Name Status Components
- md0s1e.eli ACTIVE md0s1e
- dteske@scribe12 secure_thumb $ make status
- secure_thumb.md is attached to md0
- secure_thumb.md is mounted on mnt
- secure_thumb.md keys (md0s1d.eli) is attached
- secure_thumb.md keys is mounted on mnt/keys
- secure_thumb.md encstore (md0s1e.eli) is attached
- secure_thumb.md encstore is mounted on mnt/encstore
- dteske@scribe12 secure_thumb $ ls mnt/keys
- Makefile
- dteske@scribe12 secure_thumb $ ls mnt/encstore
- dteske@scribe12 secure_thumb $ df -h mnt/keys
- Filesystem Size Used Avail Capacity Mounted on
- /dev/md0s1d.eli 16M 2.0K 14M 0% /home/dteske/src/github/fraubsd/secure_thumb/mnt/keys
- dteske@scribe12 secure_thumb $ df -h mnt/encstore
- Filesystem Size Used Avail Capacity Mounted on
- /dev/md0s1e.eli 110M 512B 101M 0% /home/dteske/src/github/fraubsd/secure_thumb/mnt/encstore
- dteske@scribe12 secure_thumb $ make close
- sudo mdconfig -lf secure_thumb.md
- md0
- df -nh mnt
- Filesystem Size Used Avail Capacity Mounted on
- /dev/md0s1a 126M 1.0M 115M 1% /home/dteske/src/github/fraubsd/secure_thumb/mnt
- awk -v dev=/dev/md0s1a '$1=="/dev/md0s1a"{exit s=1}END{exit !s}'
- sh mnt/umount.sh
- sudo umount mnt
- sudo mdconfig -d -u 0
- rmdir mnt
- secure_thumb.md successfully unmounted and detached
- dteske@scribe12 secure_thumb $ make status
- secure_thumb.md is not attached
- secure_thumb.md is not mounted
- dteske@scribe12 secure_thumb $
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement