linux
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
linux [2017/01/21 10:27] – felixonmars | linux [2024/05/13 17:38] (current) – [Mount Target System For Chroot] felixonmars | ||
---|---|---|---|
Line 1: | Line 1: | ||
==== Create a Swap File ==== | ==== Create a Swap File ==== | ||
< | < | ||
- | SWAPFILE=/swapfile1 | + | _size=4g |
- | dd if=/dev/zero of=$SWAPFILE bs=1024 count=1048576 | + | _location=/ |
- | mkswap $SWAPFILE | + | fallocate -l $_size $_location/$_size.swap |
- | chown root: | + | chmod 600 $_location/ |
- | chmod 0600 $SWAPFILE | + | mkswap $_location/ |
+ | echo "$_location/ | ||
+ | swapon -a | ||
+ | </ | ||
+ | |||
+ | btrfs: | ||
+ | |||
+ | < | ||
+ | btrfs filesystem mkswapfile -s $_size $_location/$_size.swap | ||
</ | </ | ||
==== Mount Target System For Chroot ==== | ==== Mount Target System For Chroot ==== | ||
< | < | ||
- | TARGET=/target | + | _target=/mnt |
- | mount /dev/sdxn $TARGET | + | mount -t proc proc $_target/proc |
- | mount -t proc proc $TARGET/proc | + | mount -t sysfs sys $_target/sys |
- | mount -t sysfs sys $TARGET/sys | + | mount -o bind /dev $_target/dev |
- | mount -o bind /dev $TARGET/dev | + | mount -t devpts pts $_target/dev/pts/ |
- | mount -t devpts pts $TARGET/dev/pts/ | + | chroot $_target |
- | chroot $TARGET | + | </ |
+ | |||
+ | ==== ZSWAP ==== | ||
+ | Configuration: | ||
+ | < | ||
+ | grep -r . / | ||
+ | </ | ||
+ | Stats: | ||
+ | < | ||
+ | grep -r . / | ||
</ | </ | ||
Line 31: | Line 48: | ||
/var/lock/* | /var/lock/* | ||
/var/run/* | /var/run/* | ||
- | /var/lib/pacman/* | + | /var/log/*.gz |
+ | /var/log/**/*.gz | ||
/ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
/lost+found | /lost+found | ||
</ | </ | ||
Line 76: | Line 98: | ||
</ | </ | ||
- | ==== Install | + | ==== Install |
< | < | ||
- | echo 'deb http:// | + | echo 'deb http:// |
- | echo -e ' | + | echo -e ' |
apt-get update | apt-get update | ||
- | apt-get install -t zesty linux-image-generic linux-generic linux-headers-generic linux-libc-dev | + | apt-get install -t artful |
</ | </ | ||
linux.1484994438.txt.gz · Last modified: 2017/01/21 10:27 by felixonmars