Linux System Administration, level 1. Lecture 4: Partitioning and Filesystems Part II: Tools & Methods

Similar documents
CIS UNIX System Administration

Disks, Filesystems Todd Kelley CST8177 Todd Kelley 1

Disks, Filesystems, Booting Todd Kelley CST8177 Todd Kelley 1

File systems and Filesystem quota

Changing user login password on templates

Disks, Filesystems 1

example.com index.html # vim /etc/httpd/conf/httpd.conf NameVirtualHost :80 <VirtualHost :80> DocumentRoot /var/www/html/

7. Try shrinking / -- what happens? Why? Cannot shrink the volume since we can not umount the / logical volume.

Adding a block devices and extending file systems in Linux environments

EX200 EX200. Red Hat Certified System Administrator RHCSA

Quota LVM (Logical Volume Manager)

How To Resize ext3 Partitions Without Losing Data

An introduction to Logical Volume Management

The Ultimate Linux/Windows System

OPS235. Linux File Systems Partitioning Mounting File Systems

Lab #9: Configuring A Linux File Server

Red Hat.Actualtests.EX200.v by.Dixon.22q. Exam Code: EX200. Exam Name: Red Hat Certified System Administrator (RHCSA) Exam

EX200.exam.35q. Number: EX200 Passing Score: 800 Time Limit: 120 min. EX200. Red Hat Certified System Administrator RHCSA

EX200.redhat

LPI EXAM LPI Level 2 Exam 201, Advanced Level Linux Certification, Part 1 of 2. Buy Full Product.

EX200.Lead2pass.Exam.24q. Exam Code: EX200. Exam Name: Red Hat Certified System Administrator RHCSA. Version 14.0

Permission and Ownership

This is Worksheet and Assignment 12. Disks, Partitions, and File Systems

Seltestengine EX200 24q

LPI LPI Level Junior Level Linux Certification Part 1 of 2. Download Full Version :

Linux Files and the File System

Partitioning and Formatting Guide

Chapter 6. Linux File System

As this method focuses on working with LVM, we will first confirm that our partition type is actually Linux LVM by running the below command.

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

Exam Actual. Higher Quality. Better Service! QUESTION & ANSWER

Embedded System Design

CST8207: GNU/Linux Operating Systems I Lab Nine Disks, Partitions, and File Systems Part 2. Disks, Partitions, and File Systems - Part 2 of 2

CSE 265: System and Network Administration

Exam Name: Red Hat Certified Engineer on Redhat

Back Up (And Restore) LVM Partitions With LVM Snapshots

File system manager. Single tool to manage your storage. Red Hat. October 24, 2011

Vendor: RedHat. Exam Code: EX200. Exam Name: Red Hat Certified System Administrator - RHCSA. Version: Demo

SA2 v6 Linux System Administration II Net Configuration, Software, Troubleshooting

EX200 Exam Questions Demo Red Hat. Exam Questions EX200

Braindumps EX200 15q

Linux+ Guide to Linux Certification, Third Edition. Chapter 2 Linux Installation and Usage

RH133. Red Hat Linux System Administration

EX200 - EX200 Red Hat Certified System Administrator (RHCSA) Exam

Actual4Test. Actual4test - actual test exam dumps-pass for IT exams

Manage your disk space... for free :)

Exam Questions EX200

Manual File System Check Linux Command Line

Exam Linux-Praxis - 1 ( From )

ITDumpsKR. IT 인증시험한방에패스시키는최신버전시험대비덤프

Getting Started with Pentaho and Cloudera QuickStart VM

RHCE BOOT CAMP. Filesystem Administration. Wednesday, November 28, 12

System Administration. Storage Systems

BT Cloud Compute. Adding a Volume to an existing VM running Linux. The power to build your own cloud solutions to serve your specific business needs

Lecture 2: The file system

Commands LVM information can be created, displayed, and manipulated with the following commands:

MFT / Linux Setup Documentation May 25, 2008

RH202. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs) Exam.

CST Algonquin College 2

CSE 265: System and Network Administration

SA3 E7 Advanced Linux System Administration III Internet Network Services and Security

More on file systems, Booting Todd Kelley CST8177 Todd Kelley 1

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

Exercise 4: Access Control and Filesystem Security

Project 3: An Introduction to File Systems. COP 4610 / CGS 5765 Principles of Operating Systems

CIT 470: Advanced Network and System Administration. Topics. Filesystems and Namespaces. Filesystems

Linux File System Study Guide

Partitioning and Formatting Reference Guide

LiLo Crash Recovery. 1.0 Preparation Tips. 2.0 Quick Steps to recovery

Linux Command Line Primer. By: Scott Marshall

Comparison between Tru64 UNIX and HP-UX Filesystems and Volume-Managers

TestOut Linux Pro - English 4.0.x OBJECTIVE MAPPING: CompTIA Linux+ LX0-103

CS370 Operating Systems

The UNIX File System

Kernel Korner IBM's Journaled Filesystem

UNIX File Hierarchy: Structure and Commands

LPI Linux LPIC1. Module 4

CS370 Operating Systems

File System Internals. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

File System. yihshih

The UNIX File System

File Systems. What do we need to know?

Unix Filesystem. January 26 th, 2004 Class Meeting 2

Testpassport.

Tru64 UNIX and HP-UX File Systems and Volume Managers

Advanced UNIX File Systems. Berkley Fast File System, Logging File System, Virtual File Systems

OPENARCHIVE The Final Destination of Your Data. Quick Start Guide

Computer Systems Laboratory Sungkyunkwan University

RH-202. RedHat. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs)

The table below lists the domains measured by this examination and the extent to which they are represented in the examination.

Full file at

File System Internals. Jo, Heeseung

Welcome. A Basic Tutorial Introduction to Using. Floppy Diskettes. Not Dead Yet. By Stan Reichardt

Linux Administration

TDDB68 Concurrent Programming and Operating Systems. Lecture: File systems

Learn Linux, 101: Control mounting and unmounting of

Manage Directories and Files in Linux. Objectives. Understand the Filesystem Hierarchy Standard (FHS)

Use the Reiser4 file system under Linux rev.2

Manually Mount Usb Flash Drive Linux Command Line Redhat

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Transcription:

Linux System Administration, level 1 Lecture 4: Partitioning and Filesystems Part II: Tools & Methods

The sequence 1. Create one or more empty partitions 1a. (optional) Arrange them into a RAID or LVM device and create one or more volumes therein 2. Create a filesystem on each empty volume 3. Mount the volume(s) into your filesystem tree 3a. (optional) Configure /etc/fstab to automatically mount the volume at boot time

Partitioning tools fdisk the CLI standard Not difficult to master if you understand partitioning Disk Druid Red Hat's GUI tool Unfortunately, only available during install parted PARTition EDitor Resizes partitions fips resizes 'doze partitions

Creating a RAID 1. Create RAID partitions (type FD) 2. Create /etc/raidtab; specify partitions See lab exercise for details 3. mkraid /dev/mdx to create the RAID 4. Create a filesystem on it & mount it --- OR... just create it at install time in Disk Druid

RAID tools raidstart, raidstop raidsetfaulty device partition to simulate a failed drive raidhotremove, raidhotadd remove a failed drive from an active RAID, add a (properly partitioned) drive to an active RAID mdadm configure/administer RAIDs lsraid list RAID devices

Creating Logical Volumes 1. Create LVM partitions (type 8E) 2. vgscan to initialize 2 database files (1 time only) 3. pvcreate partition to register the Physical Volumes 4. vgcreate devname to create the Volume Group 5. lvcreate -L size -n name devname to create the Logical Volume --- OR... just create it at install time in Disk Druid

LVM tools vgextend volgroup partition to add a new partition to a Volume Group pvmove partition to move data from a physical volume before removing it vgreduce volgroup partition to remove a Physical Volume from a Volume Group pvdisplay, vgdisplay, lvdisplay for information about your LVM components

Creating filesystems mke2fs options device create an ext2 filesystem Options (not an exhaustive list): -j create a journaling (i.e. ext3) filesystem -L set the filesystem's volume label -c check for bad blocks -R stride=number set the chunk size (optimizes performance if the filesystem is on a RAID)

Resizing a logical volume e2fsadm options device to resize an ext2/ext3 logical volume Examples of options are: -L +100M to increase the LV and FS by 100 MB -L -50M to decrease the LV and FS by 50 MB Calls lvextend or lvreduce Then calls resize2fs

More filesystem tools e2fsck device to check an ext2/ext3 filesystem for errors Must be unmounted In most cases you can use fsck instead No defragment tool ext2/ext3 normally doesn't fragment (unless you fill the partition) tune2fs convert an ext2 fs to ext3 and more dosfsck and mtools for FAT filesystems

Mounting and unmounting Simplest mount command: mount what-to-mount where-to-mount-it What-to-mount is a device. In Unix, all devices are files that live in /dev Your mountpoint is an empty directory you've created somewhere in your tree. Example: mount /dev/hda1 /windoze To unmount: umount device (or) umount mountpoint

mount options mount -o options device mountpoint Options separated by commas (no spaces), can incl. ro, rw mount the device read-only or writeable umask=number to set permissions for FAT loop number to mount a filesystem that is contained in a file (i.e., not in /dev) e.g. a CD- ROM image (.iso file) or an image of a floppy More when we look at /etc/fstab

/etc/fstab: automatic mounting Items in this file will automatically mount at boot Six fields, separated by whitespace: 1. Device name 2. Mountpoint 3. Filesystem type 4. Mount options 5. Level 0 dump frequency 6. fsck order

fstab fields 1-3 1. Device Must be a block device or network share Examples: /dev/hda4 or 10.20.30.4:/home May be a volume label 2. Mountpoint 3. Filesystem type See man mount for the list of possible types Common types are ext3, vfat, iso9660, smb, nfs

fstab field 4 4. Mount options See man mount for the list Special mount options for fstab include auto or noauto whether to mount at boot user or nouser whether non-root users can mount this device. Normally used for CD-ROMs and floppies. noatime do not update the files' access times (speeds disk access on busy systems with many small files) defaults means rw,suid,dev,exec,auto,nouser,async

fstab fields 5-6 5. Level 0 dump frequency 0 never 1 daily, 2 every other day, 3 etc. 6. fsck order 0 don't fsck (usually means it's not an ext2/3 fs) 1 fsck first (only set on root filesystem) 2-9 Second, third, etc. Can be done in parallel. If these fields are missing they are presumed 0

Unix fs owners and permissions Each file is owned by a user and by a group Each file has three sets of permissions: User ( u - the user that owns the file) Group ( g - the group that owns the file) Others ( o - aka the world ) In each set are three possible permissions: read ( r ), write ( w ) and execute ( x ) Represented in nine bits, or three Octal digits

The nine permission bits Three groups... 1 st group: Owner permissions ( u ) 2 nd group: Group permissions ( g ) 3 rd group: World permissions ( o )... of three bits each The 4 bit: Read permission ( r ) The 2 bit: Write permission ( w ) The 1 bit: Execute permission ( x )

Octal representation of the nine bits 100 (read, no write, no execute) = 4 110 (read and write, no execute) = 6 111 (read, write and execute) = 7 101 (read and execute, no write) =??? 755 = owner can read, write & execute; group and world can only read & execute 640 = owner can read & write, group read only, world no access

The 9 bits a la ls -l One character plus rwxrwxrwx If a permission is off, it's a dash: rwxr-xr-x First character: d This file is a directory c This file is a character device (in /dev) b This file is a block device (in /dev) l This file is a symlink

Permissions tools - chown chown, chgrp Change user/ group ownership of a file Both can be done with chown: chown user.group filename Recurse with -R chown -R ken.users *

Permissions tools - chmod chmod Change permissions on a file Can be done symbolically or with Octal chmod g+r filename chmod u-x filename chmod 755 filename Recurse with -R enable group read disable owner execute Octal sets all nine bits chmod -R o+r * make everything in this directory and all directories under it world-readable

One last tool: ln ln -s sourcefile destname makes a symlink One file appears in many directories, but is physically stored only once Works across filesystems, even into remote and dosfs Operations (read, write, execute) on symlink access the actual file Delete operates on the symlink, not the actual file ln sourcefile destname makes a hard link Only works on the same filesystem