Top Banner
1 © David Morgan 2004-2016 Installing an operating system Installing an operating system David Morgan © David Morgan 2004-2016 Partitions Partitions what they are hard drive has them – up to 4 primary (traditional) – up to 128 (newer GPT “GUID partition table”) extended/logical (to break limit of 4) MBR – contains partition table (traditional)
14

Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

Mar 23, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

1

© David Morgan 2004-2016

Installing an operating systemInstalling an operating system

David Morgan

© David Morgan 2004-2016

PartitionsPartitions

� what they are

� hard drive has them

– up to 4 primary (traditional)

– up to 128 (newer GPT “GUID partition table”)

� extended/logical (to break limit of 4)

� MBR – contains partition table (traditional)

Page 2: Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

2

© David Morgan 2004-2016

Diskette LayoutDiskette Layout

Boot sector

Data area

© David Morgan 2004-2016

Hard disk layoutHard disk layout

Boot sector

Boot sector

Boot sector

Boot sector

Data area - partition 1

MBR

Data area - partition 2

Data area - partition 3

Data area - partition 4

Page 3: Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

3

© David Morgan 2004-2016

MBR MBR -- Master Boot RecordMaster Boot Record

Code (bootloader) Partition Table

446 bytes 64 bytes 2

© David Morgan 2004-2016

Partition Table RecordPartition Table Record

http://www.win.tue.nl/~aeb/partitions/partition_tables.html

http://www.edm2.com/0603/drive.html

Active TypeStart H/SC End H/SC Partition start

(sector)

Partition size*

(sectors)80H

00H

* the encoding used here can

represent a 2TB partition size,

maximum. Modern disks can

be bigger. This requires a

replacement, known as GUID

partition tables.

Page 4: Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

4

© David Morgan 2004-2016

Example Example –– a diska disk’’s 3s 3rdrd partitionpartition

80 00 81 95 83 3f ff e4 c0 aa 28 00 00 ac 14 00

Active TypeStart H/SC End H/SC Partition start

(sector)

Partition size

(sectors)80H

00H

Disk /dev/hda: 64 heads, 63 sectors, 1023 cylinders

Units = sectors of 1 * 512 bytes

Device Boot Start End Blocks Id System

/dev/hda1 63 1641023 820480+ c Win95 FAT32 (LBA)

/dev/hda2 1641024 2665151 512064 7 HPFS/NTFS

/dev/hda3 * 2665152 4019903 677376 83 Linux

/dev/hda4 4019904 4124735 52416 82 Linux swap

output of “fdisk –l” command:

© David Morgan 2004-2016

PC Booting PC Booting sequence sequence (traditional)(traditional)

� BIOS’s code

� MBR’s code

� then what?– MBR’s code passes control downstream

– “where to” depends entirely on MBR’s code

� if “standard/dos” MBR– To boot sector of partition marked active in table

� if lilo or GRUB– to known code at a predetermined disk location

Page 5: Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

5

© David Morgan 2004-2016

PC Booting sequencePC Booting sequence

kernel

.

bios firmware code

boot loader

© David Morgan 2004-2016

Multiple drivesMultiple drives

� can have many hard drives

� each follows this partition scheme

Page 6: Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

6

© David Morgan 2004-2016

Referring to partitionsReferring to partitions

� MS uses letters like C:

� Linux does not

© David Morgan 2004-2016

Linux partition nomenclatureLinux partition nomenclature

� “device names” are used

� sda vs. sdb– differentiate drives

� sda vs. sda1 sda2 etc– differentiate drives from their partitions

� sda1-4 vs. sda5-8– differentiate primary/extended partitions from logical ones

Page 7: Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

7

© David Morgan 2004-2016

Partitioning for InstallationPartitioning for Installation

� Linux requires at least 1 partition

� a second partition for “swap” is beneficial

� may utilize several partitions

– each with its own “filesystem”

– each “filesystem” holds part of the tree

– glued together by “mount” at boot/run time

© David Morgan 2004-2016

Installation requirementsInstallation requirements

� an available existing partition, or

� empty space from which to create one

– large enough

– allowable within partition rules (4 max)

Page 8: Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

8

© David Morgan 2004-2016

Partition(s) receive file systemPartition(s) receive file system

� file system has physical type

� file system has logical directory hierarchy

� both are called “file system”gotcha!

ambiguous

term

© David Morgan 2004-2016

A physical filesystemA physical filesystem’’s layouts layout

data

data

data

disk:

directory

name

pointer

info

name

pointer

info

name

pointer

info

� purpose: associate names with bodies of data (aka “content”)

� method: reserve part of the disk for a directory

� analogous to book’s table of contents consuming first few pages

Page 9: Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

9

© David Morgan 2004-2016

Physical filePhysical file systemsystem typestypes� FAT DOS

� FAT32 Windows 98

� HPFS OS/2

� NTFS Windows NT

� ext2/ext3 Linux

� iso9660 CD-ROM

© David Morgan 2004-2016

An example: FATAn example: FAT

Advanced MSDOS, Ray Duncan, Microsoft Press, 1986, p. 149

Page 10: Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

10

© David Morgan 2004-2016

Reading file system typesReading file system types

� Linux can read its own file system type

– ext2

� Linux can read other types of file systems

– FAT

– FAT32

– iso9660

– NTFS

© David Morgan 2004-2016

A logical fileA logical file systemsystem’’s organization:s organization:a hierarchya hierarchy

� a tree structure of directories

� the directory tree is mostly standardized

� but varies slightly among distributions

portions can spread

across

different partitions

Page 11: Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

11

© David Morgan 2004-2016

Mounting file systemsMounting file systems� grafting “subdirectories” onto file tree

� integrates different devices’ subtrees into a single hierarchy

� grafting location in tree called “mount point”

� examples

– transient mount of diskette drive to access floppy

– mount a new hard drive to incorporate its capacity

� /etc/fstab for mount persistency

© David Morgan 2004-2016

Replacing BIOS: Replacing BIOS: extensible firmware interfaceextensible firmware interface

Page 12: Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

12

© David Morgan 2004-2016

1TB GPT drive1TB GPT drive

“protective MBR”

legacy partition record

type code “ee” =

GUID partition table

© David Morgan 2004-2016

Where to Get More InformationWhere to Get More Information

“Make the most of large drives with GPT and Linux,

Preparing for future disk storage with the GUID Partition Table”http://www.ibm.com/developerworks/library/l-gpt/

GPT fdisk tutorialshttp://www.rodsbooks.com/gdisk/index.html

http://www.sysresccd.org/Sysresccd-Partitioning-EN-The-new-GPT-disk-layout

GUID partition tablehttp://en.wikipedia.org/wiki/GUID_Partition_Table

Page 13: Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

13

© David Morgan 2004-2016

Where to Get More InformationWhere to Get More Information

---- on your computeron your computer

� Man pages

� “documentation” subdirectories( e.g. /usr/share/doc/ )

© David Morgan 2004-2016

Where to Get More Information Where to Get More Information

---- on the interneton the internet

� The Linux Documentation Project (www.tldp.org)

– HOWTOs� Linux Partition HOWTO

� Filesystems HOWTO

– Guides� The Linux System Administrators' Guide

� Linux Filesystem Hierarchy

� Distributions’ documentation

– http://fedoraproject.org/

Page 14: Installing an operating system - Santa Monica Collegehomepage.smc.edu/morgan_david/linux/dayone-short.pdf · 2016-05-27 · – A Practical Guide to Linux, Sobell, Addison-Wesley

14

© David Morgan 2004-2016

Where to Get More InformationWhere to Get More Information

---- other sourcesother sources

� Linux Journal http://www.linuxjournal.com/

� Selected books– A Practical Guide to Linux, Sobell, Addison-Wesley 1997

– Practical Guide to Fedora and Red Hat Enterprise Linux, Sobell,

Prentice-Hall 2014

– UNIX and Linux System Administration Handbook, Nemeth,

Snyder, Hein & Whaley, Prentice Hall 2011

– Fedora 10 and Red Hat Enterprise Linux Bible, Christopher

Negus, Wiley 2009