Using Arch Linux on a Lenovo Thinkpad x201 almost everything works out of the box but one needs to tweak the configuration a bit for some special cases…
/dev/sda1 boot 512 MiB /dev/sda2 -> /dev/mapper/lvm
vgcrypt-system -> 25G vgcrypt-swap -> 8G vgcrypt-home -> 800G
Boot from an Arch Linux live system.
loadkeys de fdisk /dev/sda
cryptsetup luksFormat /dev/sda2 cryptsetup luksOpen /dev/sda2 lvm
pvcreate /dev/mapper/lvm vgcreate vgcrypt /dev/mapper/lvm
lvcreate -L 25G -n system vgcrypt lvcreate -L 8G -n swap vgcrypt lvcreate -L 800G -n home vgcrypt
mkswap /dev/mapper/vgcrypt-swap mkfs.ext4 /dev/mapper/vgcrypt-system mkfs.ext4 /dev/mapper/vgcrypt-home
mount /dev/mapper/vgcrypt-system /mnt
mkdir /mnt/home
mount /dev/mapper/vgcrypt-home /mnt/home
mkdir /mnt/boot mount /dev/sda1 /mnt/boot
pacstrap /mnt base base-devel pacstrap /mnt grub-bios
genfstab -p -U /mnt > /mnt/etc/fstab echo "/dev/mapper/vgcrypt-swap none swap defaults 0 2" >> /mnt/etc/fstab
Now edit /mnt/etc/fstab and replace „relatime“ by „noatime“.
arch-chroot /mnt vi /etc/locale.gen locale-gen echo LANG=en_GB.UTF-8 > /etc/locale.conf
Create the file /etc/vconsole.conf and edit:
KEYMAP="de"
Timezone:
ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
echo yourhostname > /etc/hostname
Edit /etc/mkinitcpio.conf and add „keymap“, „encrypt“ and „lvm2“ in this order before filesystems in HOOKS.
mkinitcpio -p linux
grub-install /dev/sda
Edit /etc/default/grub
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:vgcrypt resume=/dev/mapper/vgcrypt-swap"
grub-mkconfig -o /boot/grub/grub.cfg
passwd
exit
umount /mnt/home umount /mnt/boot umount /mnt
sync sync reboot
pacman -S plasma-meta xorg-xinitrc mc firefox chromium FIXME ...
Install yaourt: https://wiki.archlinux.org/index.php/Yaourt
systemctl enable NetworkManager systemctl start NetworkManager
https://wiki.archlinux.org/index.php/MAC_address_spoofing – NetworkManager method
https://wiki.archlinux.org/index.php/MAC_address_spoofing#macchanger
Create the following file in /etc/systemd/network/:
[Match] Name=enp0s25 [Network] DNS=192.168.0.1 Address=192.168.0.100 Gateway=192.168.0.1
systemctl enable systemd-networkd
Does not work for me: <s>Use the „NetworkManager“ methot from https://wiki.archlinux.org/index.php/IPv6#Disable_IPv6</s>
vim /etc/sysctl.d/50-disable-ipv6.conf:
# Disable IPv6 net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.enp0s25.disable_ipv6 = 1 net.ipv6.conf.wlp2s0.disable_ipv6 = 1
Or alternatively do not disable ipv6 and enable privacy extensions https://wiki.archlinux.org/index.php/IPv6#NetworkManager
Add the following to /etc/systemd/system.conf:
DefaultTimeoutStartSec=10s DefaultTimeoutStopSec=10s
Disabled … :), because of https://www.kernel.org/doc/Documentation/sysctl/vm.txt
Use of this file can cause performance problems. Since it discards cached objects, it may cost a significant amount of I/O and CPU to recreate the dropped objects, especially if they were under heavy use. Because of this, use outside of a testing or debugging environment is not recommended.
Create /etc/systemd/system/drop_caches.service:
<source>
[Unit]
Description=Drop caches
[Service]
ExecStart=/usr/local/bin/drop_caches.sh
[Install]
WantedBy=multi-user.target
</source>
Create /etc/systemd/system/drop_caches.timer:
<source>
[Unit]
Description=Drop caches once an hour
[Timer]
OnBootSec=30min
OnUnitActiveSec=1h
Unit=drop_caches.service
[Install]
WantedBy=timers.targe
</source>
systemctl enable drop_caches.timer
systemctl start drop_caches.timer
[https://wiki.archlinux.org/index.php/Systemd/Timers Information about timers in systemd]
Disable Copy on Write for /var/log/journal: https://wiki.archlinux.org/index.php/systemd#Journal
pacman -S smartmontools systemctl start smartd systemctl status smartd systemctl enable smartd journalctl -u smartd
If https://wiki.archlinux.org/index.php/Dm-crypt/Specialties#Discard.2FTRIM_support_for_solid_state_drives_.28SSD.29 is not a concern for you, then pass the „allow-discards“ option to your grub.cfg and then run manually a fstrim every x time.
The package „util-linux“ contains a fstrim timer…
Enable and start it with:
systemctl enable --now fstrim.timer
It will run once a week and trim all supported filesystems (fstrim -a).
If you need to specify the exact time the timer has to start, you can do this with:
systemctl edit fstrim.timer
Paste:
[Timer] OnCalendar=Sun 19:00 Persistent=false Unit=fstrim.service
systemctl restart fstrim.timer
And check with:
systemctl list-timers
Create the file named startboot.service inside /etc/systemd/system/
[Unit] Description=My script [Service] ExecStart=/usr/local/bin/startup.sh #old /etc/rc.local script [Install] WantedBy=multi-user.target
Enable it:
systemctl enable startboot.service
The script must contain „#!/bin/bash“ in the first line.
Enable time sync with:
timedatectl set-ntp true
pacman -Sy kde-gtk-config
The ionice binary is available in the package schedtool.
In case you have a very fast mouse where even the lowest speed is too fast, use:
Section "InputClass" Identifier "Mouse" MatchIsPointer "on" MatchDevicePath "/dev/input/event*" Option "ConstantDeceleration" "2.55" EndSection
Clementine needs the old version of gstreamer.
Install:
pacman -Sy gstreamer0.10-plugins
For KDE SC install kcm-touchpad|community and for Plasma 5 install kcm-touchpad-frameworks|community.
Not needed anymore; SSD is faster :)
* https://wiki.archlinux.org/index.php/Dm-crypt/Swap_encryption
I use the [https://wiki.archlinux.org/index.php/Dm-crypt/Swap_encryption#LVM_on_LUKS first] mentioned method.
In my case the filename is /etc/modprobe.d/wlan.conf
And the content is:
options iwlwifi led_mode=1
pacman -S acpi_call ethtool lsb-release tp_smapi x86_energy_perf_policy systemctl enable tlp systemctl start tlp systemctl enable tlp-sleep systemctl start tlp-sleep
systemctl disable systemd-rfkill systemctl stop systemd-rfkill
I use the following script to disable WWAN and Bluetooth again after starting Mumble:
#!/bin/bash rfkill block $(/usr/bin/rfkill list | sed -r -n -e "s/([0-9]{1,2})\: tpacpi_wwan_sw.*/\1/p") rfkill block $(/usr/bin/rfkill list | sed -r -n -e "s/([0-9]{1,2})\: tpacpi_bluetooth_sw.*/\1/p")
Use the rfkill list
command to get the exact names for each device.
One can't just use static ids because they may change.
In this example the user who needs to run the script is user
.
Paste the code from above to a file named /usr/local/bin/disable_wwan_bluetooth.sh
, install sudo and add the file /etc/sudoers.d/user
with the following content:
user ALL=(root) NOPASSWD: /usr/local/bin/disable_wwan_bluetooth.sh ""
Now the user can execute the script without the need to enter a password:
sudo /usr/local/bin/disable_wwan_bluetooth.sh
On my setup with KDE SC 4.x and the dockingstation KDE always ask how to configure the screen when attaching my laptop to the dockinstation. Instead of configuring this again and again I just press „No“ and let a script configure my screen layout:
#!/bin/bash /usr/bin/xrandr --output LVDS1 -s 1280x800 /usr/bin/xrandr --output HDMI1 -s 1980x1080 /usr/bin/xrandr --output HDMI1 --right-of LVDS1 /usr/bin/xrandr --output LVDS1 --primary
BTW: This works well on Plasma 5 without a helper script.
Not needed anymore; I do have an SSD :)
This daemon has access to motion sensors and monitors the movement of your laptop. It it is too much it parks your hard drive.
A tutorial can be found at https://wiki.archlinux.org/index.php/Hard_Drive_Active_Protection_System.
But the configuration file there doesn't work for me because of the
'-blp
' parameters.
Instead, my configuration file is:
<source>
[Service]
ExecStart=
ExecStart=/usr/bin/hdapsd –sensitivity=40 -l
</source>
The filename is '/etc/systemd/system/hdapsd@sda.service.d/override.conf
'