User Tools

Site Tools


linux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux [2017/01/05 06:41] – created felixonmarslinux [2024/05/13 17:38] (current) – [Mount Target System For Chroot] felixonmars
Line 1: Line 1:
 ==== Create a Swap File ==== ==== Create a Swap File ====
 <code> <code>
-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:root $SWAPFILE +chmod 600 $_location/$_size.swap 
-chmod 0600 $SWAPFILE+mkswap $_location/$_size.swap 
 +echo "$_location/$_size.swap none swap defaults 0 0" >> /etc/fstab 
 +swapon -a 
 +</code> 
 + 
 +btrfs: 
 + 
 +<code> 
 +btrfs filesystem mkswapfile -s $_size $_location/$_size.swap
 </code> </code>
  
 ==== Mount Target System For Chroot ==== ==== Mount Target System For Chroot ====
 <code> <code>
-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+</code> 
 + 
 +==== ZSWAP ==== 
 +Configuration: 
 +<code> 
 +grep -r . /sys/module/zswap/parameters/ 
 +</code> 
 +Stats: 
 +<code> 
 +grep -r . /sys/kernel/debug/zswap/
 </code> </code>
  
Line 31: Line 48:
 /var/lock/* /var/lock/*
 /var/run/* /var/run/*
-/var/lib/pacman/*+/var/log/*.gz 
 +/var/log/**/*.gz
 /var/cache/pacman/pkg/* /var/cache/pacman/pkg/*
 +/home/**/.cache/chromium/*
 +/home/**/.ccache/*
 +/home/**/.avfs
 +/home/**/.gvfs
 /lost+found /lost+found
 </code> </code>
Line 74: Line 96:
 <code> <code>
 echo "noop" > /sys/block/`readlink /dev/disk/by-uuid/$UUID|sed "s/.*\(sd[a-z]\).*/\1/"`/queue/scheduler echo "noop" > /sys/block/`readlink /dev/disk/by-uuid/$UUID|sed "s/.*\(sd[a-z]\).*/\1/"`/queue/scheduler
 +</code>
 +
 +==== Install Artful Kernel (4.13) on Xenial ====
 +<code>
 +echo 'deb http://archive.ubuntu.com/ubuntu/ artful main' >> /etc/apt/sources.list.d/artful.list
 +echo -e 'Package: *\nPin: release a=artful\nPin-Priority: 100\n' >> /etc/apt/preferences.d/artful.pref
 +apt-get update
 +apt-get install -t artful linux-image-generic linux-generic linux-headers-generic linux-libc-dev
 </code> </code>
  
Line 80: Line 110:
   * http://apt-blog.net/backup_or_migrate_linux_system_using_tar   * http://apt-blog.net/backup_or_migrate_linux_system_using_tar
   * http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/   * http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/
 +  * https://axebase.net/blog/2016/12/27/zesty-kernel-in-yakkety-und-xenial/
linux.1483598496.txt.gz · Last modified: 2017/01/05 06:41 by felixonmars