User Tools

Site Tools


linux:distros:server:ubuntu_server

This is an old revision of the document!


Information

  • Alira = Dell Precision M6500 1)
25.10 (Questing Quokka)

Download

Installation Notes

Network

  • Subnet: 192.168.1.0/24

Software

Update

System

sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt clean && sudo systemctl daemon-reload && sync

Snaps

sudo snap refresh && sync

Firmware

sudo fwupdmgr refresh --force && sudo fwupdmgr update --verbose && sync

General

sudo apt install --install-recommends htop lm-sensors

Settings

lm_sensors

sudo sensors-detect --auto

Time

sudo timedatectl set-timezone 'America/New_York' && sudo timedatectl 'set-ntp' 'true' && timedatectl status

Uncomplicated Firewall

  • Allows SSH on LAN
  • See ufw for more notes
sudo ufw reset && sudo ufw default 'deny' && sudo ufw logging 'off' && sudo ufw allow from '192.168.1.0/24' to 'any' port '22' proto 'tcp' && sudo ufw enable && sudo systemctl enable 'ufw'
sudo ufw status

Boot Loader

Alira

modprobe.d

GRUB

  • GRUB_CMDLINE_LINUX= (not default)
sudo -e '/etc/default/grub' && sudo update-grub
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX="x"
acpi_osi='Linux' reboot='pci' hibernate='no' preempt='full' iommu='pt' pci='pcie_bus_perf' drm_kms_helper.poll='0' drm_kms_helper.fbdev_emulation='0' rootflags='data=writeback' workqueue.default_affinity_scope='smt'

Drive Maintenance

Trim

sudo systemctl enable 'fstrim.timer' --now
sudo systemctl start 'fstrim' && sync && sudo systemctl status 'fstrim' -l
sudo fstrim -v -a

Tweaks

fstab

sudo -e '/etc/fstab'

ext4

  • / type ext4
  • :!: data=writeback requires it in GRUB too
,data=writeback,nobarrier

Automatic Updates

Service

sudo -e '/etc/systemd/system/ubuntu-up.service'
[Service]
Type=oneshot

ExecStartPre='/usr/bin/apt' autoremove -y

ExecStart='/usr/bin/apt' clean
ExecStart='/usr/bin/apt' update
ExecStart='/usr/bin/apt' full-upgrade -y

ExecStart='/usr/bin/snap' refresh

ExecStartPost='/usr/bin/journalctl' --vacuum-time='1s' --rotate
ExecStartPost='/usr/bin/systemctl' daemon-reload
ExecStartPost='/usr/bin/sync'
ExecStartPost='/usr/bin/systemctl' reboot

# End

Timer

  • 06:00 Alira
sudo -e '/etc/systemd/system/ubuntu-up.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'ubuntu-up.timer' --now
[Unit]
Description=Ubuntu OS Updater
After=network-online.target
Wants=network-online.target

[Timer]
OnCalendar=*-*-* 06:00:00
Persistent=true

[Install]
WantedBy=timers.target

# End
sudo systemctl start 'ubuntu-up'

External Backup

  • :!: 2023/05/04: This hasn't been used for years and likely needs re-factored

fstab

  • Expects a drive of some kind with a XFS partition at /dev/sdb1
sudo mkdir -p '/mnt/USB' && sudo -e '/etc/fstab'
# USB
/dev/sdb1 /mnt/USB xfs rw,relatime,attr2,inode64,noquota 0 2
sudo mount '/dev/sdb1'

Service

sudo -e '/etc/systemd/system/backup-external.service' && sudo sed -i 's/CHANGEME/'$USER'/g' '/etc/systemd/system/backup-external.service'
[Service]
Type=oneshot
ExecStartPre='/usr/bin/sync'
ExecStart='/usr/bin/rsync' -r '/home/CHANGEME/backups' '/mnt/USB' --verbose --ignore-existing
ExecStartPost='/usr/bin/sync'

Timer

sudo -e '/etc/systemd/system/backup-external.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'backup-external.timer' --now
[Unit]
Description=Backup Backups to External Device

[Timer]
OnCalendar=*-*-* 07:00:00
Persistent=true

[Install]
WantedBy=timers.target

Notable Folders and Commands

1)
Legacy/MBR
/var/www/wiki/data/attic/linux/distros/server/ubuntu_server.1766210703.txt.gz · Last modified: by Sean Rhone

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki