Professional Documents
Culture Documents
Advanced 3 - DIY Linux Pre-Install
Advanced 3 - DIY Linux Pre-Install
find a partner
● Install the OS
a. Partition disks
b. Choose filesystems
c. Install base system
d. chroot, initial system configuration
i. root password, /etc/network/interfaces
Installation Media
● CD/DVD
○ Old school: burn an ISO with a full system on it, set BIOS to boot from the disk, then run scripts
that basically copy the CD’s contents to your HDD and set up the new system
● USB live media
○ Same as above, but on a flash drive (most common at home)
● PXE
○ Pre-boot eXecution Environment
○ Retrieve an executable environment using DHCP and TFTP, boot that, and use that to
bootstrap the rest of the booting process.
● Netboot
○ Don’t install anything, don’t use a disk. Load kernel into memory over the network, everything
happens in memory. All state is volatile.
Live Activity:
● Examples:
○ making sure you’re on the right machine
○ making sure you’re on the right drive or partition
○ making sure your hardware works, like memory, NIC, etc.
Install Process
1. Optionally configure language and keyboard right now
2. Navigate to “Configure Network”
3. Select “yes” when asked to autoconfigure network
a. This is DHCP - the NIC will make an L2 request for IP address, netmask, DNS server and set
this for you.
b. Look at the config files before clicking through - they should be:
i. IP Address, Hostname
ii. Domain - this is the default DNS search domain
4. Choose mirror: select “mirrors.ocf.berkeley.edu”
5. Download installer components: look through the options but don’t select
anything before clicking through. Ask questions if you’re curious.
6. Configure the clock: put “ntp1.ocf.berkeley.edu”
Complete Install Steps
Until
“Partition Disks”
Partitioning
● Each storage device on your computer is divided into “partitions”
○ Fixed-size subset of disk treated by OS as a single unit
● This happens below the filesystem level
● Ex.
○ GUID Partition Table
○ Master Boot Record
● Disks need to be partitioned before you can install a FS on a partition
● This is necessary because the partition map tells the bootloader where to find
the boot/root partitions/filesystems
Example: dkessler’s laptop, SSD
Example: dkessler’s laptop, HDD
OCF Hypervisor (jaws)
Explanation
(guided)
Filesystems (Old, Inferior, Inferior)
● FAT32: ubiquitous, probably used on your flash drive/SD card
○ File Allocation Table
○ Very old, with a simple implementation; understood by almost any
computer made since 1996
○ Max file size of 2GB
○ Take CS162 to learn how it works
ext4
● ext3, ext4: most common Linux filesystem family, ext4 stable in ‘08
● Workhorse, general-purpose filesystem with support for
○ Journaling - action log that helps prevent corruption from crashes
○ Extents - range of blocks, take 162
○ Checksumming
○ Nanosecond timestamps
● Solid choice if you don’t have more specific needs
○ Google uses ext4 as the on-disk FS below Colossus/GFS
More filesystems - btrfs (B-Tree FS)
● Dev. by Oracle, stable but relatively experimental
● Fancy tech: copy-on-write, compression, online expansion (!), in-place
upgrade from ext4
● “subvolumes”: ~lightweight partitions/block devices
● Snapshots: CoW = lightweight backups of only deltas between files
● Copy-on-write can be dangerous though -- has bad performance for
certain types of files, like VM disks, where lots of things are changed
all over
● Generally used by adventurous Linux users on their personal
machines
More filesystems
● ReiserFS
○ Invented by Hans Reiser, a co-founder of the OCF!
○ Efficiently handles small files - can be 10-15x faster than ext3
○ Sometimes used for the /var folder
● XFS
○ High-performance 64-bit parallel FS designed by SGI, designed for “extreme scalability”
○ Extents, journaling, guaranteed-rate I/O in special cases (!)
○ NASA uses it
○ Red Hat recommends it for 100TB+ clusters
ZFS - The Final Word in File Systems
● “Zettabyte” filesystem - 128 bit addressing = max size of 2 ZB
● Many of the benefits of btrfs: checksumming, CoW, snapshots, first class block
devices (ZVOLs), FS-managed RAID (raidz), online expansion in the works
Special Filesystems
● Swap
○ Special partition/FS used for virtual memory management and paging
○ Take CS 162
● Tmpfs
○ Looks like a mounted directory but data is only in RAM. Lost on reboot.
○ Used on OCF desktops for home directories
● /proc
○ Special filesystem giving a file-like object view into processes on UNIX-like systems
○ This is where `ps` etc. get their data from
● /sys
○ pseudo-FS provided by Linux that gives information about the kernel and subsystems,
hardware devices, drivers, etc.
● /dev
○ devfs provides a file-like view of block devices, generated by udev from sysfs
Install!
Installing the Base System
Time to install the OS!
Critical Locations:
○ Accurate time is critical for many things - databases, synchronous networked tasks (distributed
computing), encryption, etc.
● Locales?
○ America is #1, but other countries insist on doing things the non-freedom way
○ Locales configure location-specific settings like number/date formats, currency, paper size,
keyboard layout,
Further reading for the curious
● For uses of swap besides “what happens when RAM runs out”:
https://chrisdown.name/2018/01/02/in-defence-of-swap.html