Created
May 7, 2015 10:38
-
-
Save v6ak/3171313bc2c22efc263d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cryptswap1 /dev/sdaX /dev/random swap,cipher=aes-cbc-essiv:sha256 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# delayed autoenable: | |
( | |
sleep 120; | |
swapon /dev/mapper/cryptswap1 | |
)& |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
largetmp1 /dev/sdaXX /dev/random tmp=ext4,cipher=aes-cbc-essiv:sha256 # not sure why tmp=ext4, this is likely reduntant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DEV=/dev/mapper/largetmp1 | |
if which zfs; then | |
( | |
#POOL=rpool | |
POOL=largetmp | |
sudo mkdir -p /tmp/large && | |
sudo modprobe zfs && | |
sudo zpool create -O mountpoint=none -O sync=disabled -O atime=off -O checksum=off -O setuid=off -O devices=off -o ashift=12 "$POOL" /dev/mapper/largetmp1 && | |
sudo zfs create "$POOL"/ROOT && | |
sudo zfs set atime=off "$POOL"/ROOT && | |
sudo zfs set mountpoint=/tmp/large "$POOL"/ROOT && | |
sudo zpool export "$POOL" && | |
sudo zpool import -d /dev/mapper -R / "$POOL" && | |
sudo chmod 1777 /tmp/large | |
#zfs create -V 8G -b $(getconf PAGESIZE) \ | |
# -o primarycache=metadata \ | |
# -o com.sun:auto-snapshot=false largetmp/swap | |
) || exit 2 | |
else | |
( | |
sudo mkfs.ext4 "$DEV" -E lazy_itable_init -m 0 -O sparse_super && | |
sudo tune2fs -o journal_data_writeback "$DEV" && | |
sudo tune2fs -O ^has_journal "$DEV" && | |
sudo mkdir -p /tmp/large && | |
sudo mount /tmp/large && | |
sudo chmod 1777 /tmp/large | |
) || exit 2 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some reworked version: https://gist.github.com/v6ak/d5d49375d59cfae8e455