0% found this document useful (0 votes)
10 views

Chapter 3 Lab Boot Disk

Uploaded by

Aashish Rokka
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Chapter 3 Lab Boot Disk

Uploaded by

Aashish Rokka
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

System and Network Administration

Boot Disk
Getting Started

TinyNet
• Comes in two parts
 Base.iso (base image)
 Config.iso (configuration
and applications)

1. Create a virtual machine


2. Partition the disk
After installing VirtualBox, 3. Create a filesystem
create VMs! 4. Copy the OS
www.my-tiny.net 5. Install the bootloader
6. Configure common services
7. Clone!
System & Network Administration
System & Network Administration
Let’s get the boot order right first, so we only boot from the CDROM when we cannot boot
from the hard disk - Has anyone seen a floppy disk lately ??
Leave the time in UTC (GMT) –file timestamps may look funny but it works better
Disk Partition

• A partition separates a disk into logical “drives”


• A “DOS” (32-bit OS) partition can be one of two types:
• Primary : can hold information regarding the operating
system which is required for booting.
• Extended: only for data files

System & Network Administration


Disk partitioning: fdisk

• Reserve space for a particular function


swap space, software, user directories, shares
• Each partition is given a logical device name
C:\ D:\ E:\ etc
/dev/sda1 /dev/dsk/c0t0d0s0
• Each partition can use a different file system
• Logical volumes seamlessly span multiple partitions
Use different partitions when
• They have different functions
• They are owned/maintained differently
• They change at different rates
• Backup policy is different for each

System & Network Administration


You have to type yes (not just y) to write the partition table; don’t worry about any warnings,
they are for people with “non-virtual” hard disks.
File Systems
• Structures disk area for addressable access
– “like painting car spaces in a carpark”

• Usually unique to OS
windows: FAT, FAT32, NTFS
linux: ext2, ext4,
linux is one huge computer science
project!
• Physical sectors grouped into allocation units
called blocks in Unix and clusters in Windows
• Building File System - mkfs or format
boot sector, data area, free list

System & Network Administration


mkfs.ext4 /dev/sda1
mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1

Create a filesystem on the data partition


Make sure the mountpoint exists
Make the device available to the OS through the mountpoint in the filesystem
Then start mc – our favorite linux file manager
Windows File Systems

FAT32 NTFS
Maximum file size 4 GB Supports Exabyte size files
Max partition size 2 TB and partitions
Provides only Folder-level File-level and Folder-level
security security
3 permissions: Read, 6 standard plus “advanced”
Change, Full Control permission combinations
Data compression support
FAT32 is Encrypted File System support
common on Disk quota management
USB drives

System & Network Administration


Linux File Systems

Allowable
Maximum Maximum
File characters in Maximum Maximum
filename MBR pathname
system directory file size volume size
length length
entries

Any byte
No limit
ext3 255 bytes 0x83 except NUL 2 TB 32 TB
defined
and /

Any byte
No limit
ext4 255 bytes 0x83 except NUL 16 TB 1 EB
defined
and /

• Most of the Linux is using ext* family

System & Network Administration


Swap Space

• Swapping frees RAM by storing an image of an


idle process on disc - few modern OSs actually
do swapping
• The swap file is now used for paging – virtual
memory stored on disc
In Unix the swap file is traditionally a
partition
In Windows the swap file is always a file
• Recommended size 2.5 * RAM
Any more will probably never be used

System & Network Administration


mkswap /dev/sda2
swapon /dev/sda2

Create a filesystem the swap partition and activate it


The swap filesystem just shows it’s registration number
Swap is basically invisible – the OS takes care of it internally
Mounting Disks / Partitions

• Naming conventions for devices


– Disk: /dev/sda /dev/sda1 …
(usb will be recognised as this)
– CD/USB: /dev/sr0 …

• mount /dev/sda1 /mnt/sda1


access everything on the drive through the directory
instructions in /etc/fstab

• umount /mnt/hostshare
– cannot unmount a busy filesystem
– show open files on a filesystem: lsof

System & Network Administration


Press [F9] for the mc menu

Two directories Tree and directory

Press [Tab] to switch sides


Paths

/ root directory . here .. up one level


/tmp/foo absolute tmp/foo relative ../../foo
cd change directory mv move or rename

cd /etc
cd foo
cd ..
mv foo ofo rename
mv ofo /var/opt move
cd /var/opt/ofo
./myscript.sh execute a file stored here

System & Network Administration


Master Boot Record

• The master boot record (MBR) is the first sector of a hard disk

It includes The
a table that diagram
contains shows a
information disk with
about each two primary
partition partitions

The MBR also includes a program that reads the boot sector
record of the partition containing the operating system into RAM.
System & Network Administration
Multiple Operating Systems –
Boot Managers

• With multi-use machines and big disks it is possible to


have several different OSs
• Each OS has its own boot manager in the MBR
• Some are generalised, some not
– For example, Windows relies on files accessed from drive C:
– so install Windows first, then install Linux
• Unix loaders:
– LILO (LInux LOader),
– syslinux (common for iso)
– GRUB (GRand Unified Bootloader)

System & Network Administration


PC Bootstrap Sequence -- An
Avalanche boot

BIOS IPL loads MBR

MBR selects active partition, loads partition boot

Partition boot loads OS loader

OS loader loads kernel

Kernel initialisation loads initial process

Initial process spawns


user-level processes

IPL: Initial Program Loader


MBR: Master Boot Record

System & Network Administration


Painless Install!
Final step is to install the boot loader – BE SURE you are on the /mnt/sda1 side
Move into /boot
Highlight SetupMBR.sh and press [enter]
System & Network Administration

You might also like