written by Nick Shin - [email protected]
this file is licensed under: Unlicense - http://unlicense.org/
and, is from - https://github.com/nickshin/CheatSheets/
Ubuntu MATE 16.04 - works mostly
Ubuntu Studio 16.04 - will bomb on grub installation
NOTE: just in case grub doesn't stick: follow these wonderful instructions to fix it
dd bs=4M if=ubuntu-mate-16.04-desktop-amd64.iso of=/dev/sdX
i like to test grub configurations first "virtually" on my desktop (much faster) before burning the copies to the USB stick (much slower)...
# 30MB test image - using dummy iso files for testing grub.conf scripts
dd if=/dev/zero of=disk.img bs=1M count=30
DEVICE=disk.img
DEVICE=/dev/sdX # your USB stick
gdisk $DEVICE
o
Y
n # BIOS boot - partition #1
[enter]
[enter]
2MiB
EF02
n # EFI System - partition #2
[enter]
[enter]
10MiB # check with your system: sudo du -cks /boot/efi
EF00
n # your data - partition #3
[enter]
[enter]
[enter]
[enter]
r
h
1 2 3
N
# GPT partition 1
[enter]
N
# GPT partition 2
[enter]
N
# GPT partition 3
[enter]
Y
x
h
w
Y
# or in a single command:
parted --script $DEVICE \
mklabel gpt \
mkpart primary fat32 1 128 \
mkpart primary fat32 1 128 \
mkpart primary fat32 1 128 \
set 1 boot on
sudo apt-get install kpartx # to create device maps from partition tables
sudo kpartx -l $DEVICE # list existing partition mapping
sudo kpartx -av $DEVICE # add partition mapping
sudo mkfs.vfat /dev/mapper/loop0p2
sudo mkfs.ext4 /dev/mapper/loop0p3
mkdir efi mnt
sudo mount /dev/mapper/loop0p2 efi
sudo mount /dev/mapper/loop0p3 mnt
sudo mkdir -p mnt/boot/iso
sudo mkfs.vfat /dev/sdX2
sudo mkfs.ext4 /dev/sdX3
mkdir efi mnt
sudo mount /dev/sdX2 efi
sudo mount /dev/sdX3 mnt
sudo mkdir -p mnt/boot/iso
sudo apt-get install grub-efi-amd64 grub-pc-bin qemu
# grub-efi-amd64 yields target: x86_64-efi
# grub-pc-bin qemu yields target: i386-pc
the following can be done either/or (UEFI or BIOS boot) -- as well as, in this order (hybrid UEFI GPT + BIOS GPT/MBR boot):
sudo grub-install --removable --recheck \
--no-nvram --efi-directory=./efi \
--boot-directory=./mnt/boot --target=x86_64-efi
sudo grub-install --removable --recheck \
--no-floppy \
--boot-directory=./mnt/boot --target=i386-pc \
/dev/loop0
mnt/boot/grub
is created- NOTE:
--{efi,boot}-directory
can be relative to where the command is run
sudo cp -duvpr grub mnt/boot/.
# repeat for however many iso files listed in grub.conf
echo dummy | sudo tee mnt/boot/iso/distro_XYZ.iso
sudo cp -duvpr iso mnt/boot/.
- goto http://distrowatch.com and click on the "Select Distribution" drop down box
- some interesting ones are:
-
tools
-
forensics
-
nerds
-
utilities
-
multimedia
-
firewall
-
small
-
- some interesting ones are:
sudo umount efi
sudo umount mnt
sudo kpartx -d $DEVICE
sudo kpartx -av disk.img ; sudo mount /dev/mapper/loop0p3 mnt
sudo cp -duvpr grub mnt/boot/.
sudo umount mnt; sudo kpartx -d disk.img
qemu-system-i386 -machine accel=kvm:tcg disk.img -serial stdio
qemu-system-x86_64 -enable-kvm -bios bios.bin disk.img
- get bios.bin from the thread here: How to boot EFI kernel using QEMU
sudo vi /etc/fstab
- NOTE: noatime,nodiratime,discard
/dev/sdbX / ext4 noatime,nodiratime,discard,errors=remount-ro 0 1
tmpfs /tmp tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0
cat /sys/block/sdX/queue/scheduler
### ensure [deadline] is used
### see External Resources links below for details
cat /proc/sys/vm/swappiness
### make sure it is less than 10
### 1 is ok, 0 disables swap...
sudo vi /etc/sysctl.conf
### lower swappieness setting
### vm.swappiness=1
sudo smartctl -data -A /dev/sdX
- value starts at 100
- replace/backup drive at 10 or below
- replace/backup drive at 10 or below
- replace/backup drive at 10 or below
sudo vi /etc/X11/xinit/xinitrc
- add EOF
# ASUS UX305c
# 1920x1080 13.3"
xrandr --dpi 166/eDP1
# Microsoft Surface Pro 3
# 2160×1440 12"
xrandr --dpi 216/eDP1
- find your DPI at http://dpi.lv/
there are 2 ways to control the brightness
- xrandr
# obtain display
xrandr -q | grep " connected" | awk '{ print $1; }'
# use the display to set the brightness (e.g. eDP1)
xrandr --output eDP1 --brightness 0.5
- xbacklight
sudo apt install backlight
xbacklight -inc 20 # increase backlight by 20%
xbacklight -dec 30 # decrease by 30%
xbacklight -set 80 # set to 80% of max value
xbacklight -get # get the current level
- bind (inc/dec) commands to keyboard hotkeys
- and, add the "Brighness Controller" app to the panel
- Note: xrandr will set the overall system brightness. xbacklight will be relative to that.
- System Settings -> Mouse and Touchpad
to change several settings including:- enabling two finger scrolling
- also, three and four finger touch gestures works
sudo vi /usr/share/X11/xorg.conf.d/10-evdev.conf
- add EOF
Section "InputClass"
Identifier "Surface Pro 3 cover"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "vendor" "045e"
Option "product" "07dc"
Option "IgnoreAbsoluteAxes" "True"
EndSection
- TODO: find out how to get (surface pro 3) touchpad option to show up in [ System Settings -> Mouse ]
- https://help.ubuntu.com/community/PowerManagement
- https://wiki.ubuntu.com/ReducedPowerUsage
- http://www.ubuntugeek.com/how-to-improve-ubuntu-laptop-power-management.html
- https://help.ubuntu.com/community/PowerManagement/ReducedPower
- https://wiki.archlinux.org/index.php/Power_management
- https://wiki.gentoo.org/wiki/Power_management/Guide
-
https://wiki.debian.org/SSDOptimization
- everything - including kitchen sink
-
http://www.howtogeek.com/62761/how-to-tweak-your-ssd-in-ubuntu-for-better-performance/
- access time
- trim
- tmpfs
- io scheduler
-
http://chriseiffel.com/everything-linux/how-to-set-up-an-ssd-on-linux/
- "disk" scheduler
- "drive" parameters
- tmp files
-
- UUID
-
https://help.ubuntu.com/community/AsusZenbook
- LCD (DPI)
- Touchpad (multi touch)
-
https://help.ubuntu.com/community/AsusZenbookPrime#Changing_brightness_workaround_2
- Touchpad (multi touch)
-
http://askubuntu.com/questions/620726/ubuntu-on-surface-pro-3-or-linux-at-all
- surface pro 3 (touchpad)
- https://wiki.archlinux.org/index.php/Multiboot_USB_drive
- Hybrid UEFI GPT + BIOS GPT/MBR boot
- a nice list of boot options for a number of distributions
- https://wiki.archlinux.org/index.php/GUID_Partition_Table
- gdisk basic (with hybrid MBR)
-
interesting Grub menu and theme examples
these instructions are no longer needed...
left here for reference just in case system recovery is needed
(for example) to run firmware updates
do updates and then create a recovery stick
- (meh...) if only have win8 recovery stick, but was running win10
- (yes!!!) full reset
- accessing UEFI (not really needed anymore these days)