Lecture 3 Filesystem Partitions Free Unix versions Asoc




















- Slides: 20
Lecture 3: Filesystem Partitions Free Unix versions Asoc. Prof. Guntis Barzdins Asist. Girts Folkmanis University of Latvia Oct 1, 2004
Hard Drive Construction Master Boot Record (MBR): Track 0, Sector 1 • Number of partitions and their location (max 4 primary partitions or 3 primary + 1 Extended + 12 Logical) • Pointer to partition with bootloader
HD Track arrangement Constant Sector Tracks Commonly found on early hard disks and still on floppy disks. Every track has the same number of sectors. Zone Bit Recording In this arrangement, tracks are grouped into zones. From the innermost part to the outer edge, successive zones contain more sectors per track.
HD identification w IDE drives n n n Partition identification: dev/hda dev/hdb. . . w SCSI n n n dev/sda dev/sdb. . . Note that /dev is not a real directory for accessing the contents of disks – it is rather a naming space for all hardware devices (and their drivers) present in the system, including keyboard, screen etc. The contents of disks is made available in other part of root / hierarchy.
File System Layout Bootloader can be installed in different locations (if bootloader not in MBR, the BIOS interprets MBR to find boot partition)
Boot Block The system’s primary disk unit contains a boot block that contains the bootstrapping program that loads the OS to memory. This program is invoked by the computer’s minimal bootstrap program in ROM. This boot block is often called the Master Boot Record (MBR). Different operating systems treat the MBR in very different ways. Some are flexible enough to install a boot loader in the MBR, so that the disk can contain different OS in different disk partitions. The loader for each OS is then stored at the beginning of its own partition. Examples: Windows NT/2000/xp boot loader, Linux lilo and grub. A “bootable” disk is one on which a boot block has been installed.
Mandatory partitions w root n n /dev/hda 1 (recommended) This is partition for the actual root / of the UNIX filesystem w swap n n n /dev/hda 2 (recommended) 4 GB (max with 32 bit x 86 CPU) RAM SIZE * 2 (recommended) This partition is not visible in root / and is used only by kernel for virtual memory page swapping (“raw” sectors, no structure) Theoretically swap partition is optional, if enough RAM
Optional partitions or separate HD w Typically on separate partitions n /home, /boot, /tmp, /var, /usr w Reasons for separate partitions n n n logical or physical damage reinstallation (affects only some partitions) limit overflow effects better performance shared via network
Creating Partitions: GNU Parted Notes: 1. 2. 3. 4. 5. 6. For ext 2, ext 3 and reiserfs: the start of the partition must stay fixed. For ext 2, ext 3: the partition you copy to must be bigger or exactly the same size as the partition you copy from. For ext 2 and ext 3: the checking is limited to ensuring the resize and copy commands will be ok. For fat: the size of the new partition after resizing or copying is restricted by the cluster size. Parted can shrink the cluster size, so you can always shrink your partition. However, if you can't use FAT 32 for some reason, you may not be able to grow your partition. Parted supports both FAT 16 and FAT 32. Parted can convert file systems between FAT 16 and FAT 32, if necessary. Reiserfs support is enabled if you install libreiserfs, available at http: //reiserfs. osdn. org. ua. (It is likely to be available soon from http: //www. namesys. com)
File System Types w w w w w VFS UFS / FFS System) NFS RFS S 5 FS Vx. FS JFS CFS EXT 2/EXT 3 GFS Reiser. FS XFS CXFS QFS HFS NTFS FAT 16/ FAT 32 Virtual File System UNIX File System – used interchangeably with FFS (Fast File Network File System – developed by Sun Remote File System – developed by AT&T Original System V file system Veritas Journaling File System Journaled File System – AIX Cluster file system – Tru 64 2 nd/3 rd Extended File System – Linux systems Global File System – Linux Journaling file system – Linux Extended File System – SGI and others Clustered Extended File System – SGI 64 -bit very large file system – Sun Solaris Hierarchical File System – S/390 UNIX, OS/2, Mac. OS X Windows NT/2000/2003 Windows – several versions
File System Support w Linux can interpret many file system types, including; n n n EXT 2, EXT 3, UFS/FFS, FAT 16, FAT 32 NTFS (read-only), HPFS ISO 9660, UDF, UFS, etc. w Win 32 can interpret a few file system types, including; n n FAT 16, FAT 32 NTFS
Linux Virtual File System (VFS)
Unix File System (UFS) Structure
EXT 3 File System w A journaling filesystem w Goal : use EXT 2 and complete backwards and forwards compatibility between EXT 2 and EXT 3 w batch (journal) all updates(handles) off into very large transactions and just send them all out at once w Why? n n n Availability – reduce long time fsck Data Integrity – data consistency Speed – optimizes hard drive head motion
BSD Versions w Free. BSD - Focusing on features and ease of use w Darwin (OS X) - Focusing on the desktop and multimedia with use of the Apple's Aqua Interface w Net. BSD - Focusing on portability w Open. BSD - Focusing on security w Pico. BSD - Focusing on size (extremely small) w Dragonfly. BSD - Focusing on new computing
Linux Distributions w Debian GNU/Linux (Xandros, Knopix, . . . ) n a free operating system that provides almost 4000 software packages for six architectures (Intel, Motorola, Alpha, SPARC, Power. PC, ARM) and is developed entirely by volunteers over the Internet w Fedora/Red. Hat n a Red-Hat-sponsored and community-supported open source project. The goal of The Fedora Project is to work with the Linux community to build a complete, general purpose operating system exclusively from free software. Development will be done in a public forum w Mandrake Linux n a friendly Linux Operating System which specializes in ease-of-use for both servers and the home/office. It is freely available in many languages throughout the world w Slackware n a long running Linux distribution that descends from the SLS Distribution w Su. SE Linux n an extremely popular distro that features excellent documentation, thousands of applications on a DVD/CD-ROM set w Gentoo Linux
Sun. OS w Solaris x 86
Mājas darbs: pētījums w Katrai darba grupai instalēt atšķirīgu Unix paveidu w Pētījumā (aptuveni 5 -10 lpp) detalizēti aprakstīt gūto pieredzi, ieskaitot: n n n Ar ko šī Unix versija atšķiras no citām (filozofija) Unix instalācijas process (ari screenshots etc. ) Aplikāciju instalācijas process l nokompilet un izpildit “hello world” C programmu
“Hello World” palaišana unix% cat > hello. c #include <stdio. h> int main() { printf("Hello World!n"); return 0; } Ctrl/D unix%gcc hello. c unix%. /a. out Hello World! unix%
Unix Instalacija