CIS 191 Lesson 2 Lesson Module Status Slides

  • Slides: 88
Download presentation
CIS 191 – Lesson 2 Lesson Module Status • Slides - draft • Flash

CIS 191 – Lesson 2 Lesson Module Status • Slides - draft • Flash cards – 16 • No-stress quiz – done • Web Calendar summary – done • Web book pages – done • Commands – done • Course skills pacing - done • Lab – Jim's • Classroom PC's – rh 9 isos done

CIS 191 - Lesson 2 Quiz Please book close your books, turn off your

CIS 191 - Lesson 2 Quiz Please book close your books, turn off your monitor, take out a piece of paper and answer the following questions: • In a long listing (ls –l) what code letter is used for a symbolic link? • Where in the file directory tree is the kernel and how do you recognize it? • What command option shows how the drives are partitioned?

CIS 191 – Lesson 2 Storage and File Systems Objectives Agenda Red Hat 9

CIS 191 – Lesson 2 Storage and File Systems Objectives Agenda Red Hat 9 installation High level storage overview Partitioning and making file systems. Mounting file systems manually and automatically. • Making a simple root file system. • Add VMware tools and second hard drive to a VM. • Quiz • • • Questions from last week • Storage hardware • Recognizing storage devices • Geometry • Exercise: RH 9 install • Disk partitions • Exercise: Partitioning • Making file systems • Mounting • File types • Exercise: Putting it all together • Wrap up = hands on exercise for topic

CIS 191 A Course Skills Pacing Lesson 1 VMware Server Ubuntu 8. 04 Lesson

CIS 191 A Course Skills Pacing Lesson 1 VMware Server Ubuntu 8. 04 Lesson 6 RPM, apt-get Tarballs Custom Distro Lesson 2 Lesson 3 Partitioning Make file systems RH 9 Booting Dual boot Fedora 9/DOS Lesson 5 Troubleshooting open. SUSE 11 Lesson 7 X windows Debian Install Review Final Lesson 4 Rooting Cent. OS Install

CIS 191 - Lesson 2 Last weeks Assignment 1. Student surveys due today 2.

CIS 191 - Lesson 2 Last weeks Assignment 1. Student surveys due today 2. Questions from previous week? • vmware? • ubuntu install? • course syllabus?

CIS 191 – Lesson 2 Review Exercise Becoming Root on Ubuntu • Howto sudo

CIS 191 – Lesson 2 Review Exercise Becoming Root on Ubuntu • Howto sudo [see set the password for root on ubuntu: passwd root Only need to do this white board] once to enable root on Ubuntu white board] } • Switch to root user: su - The - gives you root's path and environment

CIS 191 – Lesson 2 Review Exercise (continued) Exploring Ubuntu 8. 04 Desktop Virtual

CIS 191 – Lesson 2 Review Exercise (continued) Exploring Ubuntu 8. 04 Desktop Virtual Machine • Show network configuration: ifconfig route –n cat /etc/resolv. conf • Show hostname: hostname • Show disk partitions: fdisk –l • Mounts: mount Tip: man command google are great ways to get information on commands • Show disk space usage: du –s /* • Show CPU info: cat /proc/cpuinfo • Show RAM size and usage: free –m or top • Show installed packages: dpkg -l • Find the kernel version: uname –r • Default runlevel: runlevel

CIS 191 – Lesson 2 Review Exercise (continued) Team Process Each table is one

CIS 191 – Lesson 2 Review Exercise (continued) Team Process Each table is one team CIS 81, 82, 83 alumni identify themselves to the class Each team picks a pilot and a scribe Make introductions and share: • High school you attended • Longest job held • Team helps the pilot issue each of the quick inventory commands on previous slide. • Team answers their 3 questions on the next slide. • When finished, scribe writes answers on the white board. • Reports – when all teams are done, we will go around the room, each scribe will introduce the members of his or her team. Each pilot will explain how they got their answers. • •

CIS 191 – Lesson 2 Review Exercise (continued) Teams Table 1 -4 • What

CIS 191 – Lesson 2 Review Exercise (continued) Teams Table 1 -4 • What network (n. n /n) are we on in 2501? • Where is the kernel and what is its name? • What IP addresses are configured for the gateway and DNS server? Table 9 -12 • What partition is / mounted on? • What partition is used for swap space? • What happens if your run fdisk –l as a non-root user? Table 9 -12 • What is the default runlevel for the VM. • What does runlevel N mean? • What is the hostname and IP address? Table 5 -8 • What linux command would print a list of top level directories sorted by size? • What are the top 3 largest level directories? • What version is the kernel? Table 13 -16 • What processor (model and speed) is the VM using and what is the cache size? • What is the name of one of the Common UNIX Printing System (CUPS) packages that have been installed? • Is CUPS running now? Table 13 -16 • How much RAM does your VM have? • How much memory is being used and how much is free? • What are the –m and –k options for the free command?

CIS 191 - Lesson 2 Housekeeping

CIS 191 - Lesson 2 Housekeeping

CIS 191 - Lesson 2 • • Call roll Final surveys Fix TBA signup

CIS 191 - Lesson 2 • • Call roll Final surveys Fix TBA signup sheet Opus accounts • lllllfff/lllllffff 1

CIS 191 - Lesson 2 Storage Devices

CIS 191 - Lesson 2 Storage Devices

CIS 191 - Lesson 2 Storage Devices USB flash drive (aka pen drive) Floppy

CIS 191 - Lesson 2 Storage Devices USB flash drive (aka pen drive) Floppy drive and diskettes Hard drive (IDE and SCSI)

CIS 191 - Lesson 2 Storage Devices DAS – Direct Attached Storage NAS –

CIS 191 - Lesson 2 Storage Devices DAS – Direct Attached Storage NAS – Network Attached Storage SAN – Storage Area Networks

CIS 191 - Lesson 2 Recognizing and specifying storage devices IDE drives: Primary master

CIS 191 - Lesson 2 Recognizing and specifying storage devices IDE drives: Primary master (/dev/hda) Primary slave (/dev/hdb) Secondary master (/dev/hca) Secondary slave (/dev/hdd) SCSI drives: Each SCSI disk has a target id (1 -7) or (114). (/dev/sda, /dev/sdb, . . . )

CIS 191 - Lesson 2 Recognizing and specifying storage devices USB Flash (pen) drives:

CIS 191 - Lesson 2 Recognizing and specifying storage devices USB Flash (pen) drives: Same device naming as SCSI drives (can use dmesg to distinguish) Floppies: First drive (/dev/fd 0) Second drive (/dev/fd 1) …

CIS 191 - Lesson 2 Recognizing Storage Devices

CIS 191 - Lesson 2 Recognizing Storage Devices

CIS 191 - Lesson 2 Recognizing and specifying storage devices Master IDE drive on

CIS 191 - Lesson 2 Recognizing and specifying storage devices Master IDE drive on primary One IDE drive

CIS 191 - Lesson 2 Recognizing and specifying storage devices Master IDE drive on

CIS 191 - Lesson 2 Recognizing and specifying storage devices Master IDE drive on Secondary Master IDE drive on primary Two IDE drives

CIS 191 - Lesson 2 Recognizing and specifying storage devices USB flash (pen) drive

CIS 191 - Lesson 2 Recognizing and specifying storage devices USB flash (pen) drive IDE hard drive Floppy drive

CIS 191 - Lesson 2 Recognizing and specifying storage devices First SCSI drive, first

CIS 191 - Lesson 2 Recognizing and specifying storage devices First SCSI drive, first partition First SCSI drive, second partition fdisk doesn’t like LVM yet, so we will suppress bogus errors Used for LVM SCSI drive (with LVM)

CIS 191 - Lesson 2 Recognizing and specifying storage devices SCSI hard drive USB

CIS 191 - Lesson 2 Recognizing and specifying storage devices SCSI hard drive USB flash drive SCSI and USB Flash (pen) drive

CIS 191 - Lesson 2 dmsg command output Plugging in USB flash drive starts

CIS 191 - Lesson 2 dmsg command output Plugging in USB flash drive starts here Device identification (/dev/sdb) shows here and log ends here

CIS 191 - Lesson 2 Geometry

CIS 191 - Lesson 2 Geometry

CIS 191 - Lesson 2 Example Physical CHS Disk Drive Geometry One track 14

CIS 191 - Lesson 2 Example Physical CHS Disk Drive Geometry One track 14 tracks 8 sectors per track One sector One head on each side of platter One imaginary cylinder size = cylinders x heads x sectors per track x 512 bytes size = 14 x 6 x 8 x 512 = 344, 064 bytes 3 platters 6 heads 14 cylinders

CIS 191 - Lesson 2 Disk Drive Geometry Times have changed! • Disk drives

CIS 191 - Lesson 2 Disk Drive Geometry Times have changed! • Disk drives are no longer limited to 1024 cylinders (old BIOS restriction) • Modern track density has hit over tens of thousands of tracks per inch (the old 3. 5”diskette had 80 per side) • Zone bit recording places more sectors per track on outside tracks. E. g. A IBM 34. 2 GB Deskstar has 272 to 452 sectors per track. • NOTE: The OS uses logical disk geometry which does not match physical disk geometry. • Modern drives use Logical Block Addressing (LBA) rather than the old CHS addressing.

CIS 191 - Lesson 2 Disk Drive Geometry physical ≠ logical Modern drives have

CIS 191 - Lesson 2 Disk Drive Geometry physical ≠ logical Modern drives have variable number of sectors per track. It is not possible to represent their full capacity using the old CHS method. The BIOS shows 16 logical heads and 63 logical sectors per track and adjust the number of logical cylinders to approximate the full capacity. The OS fdisk shows 255 logical heads and 63 logical sectors per track and then adjusts logical cylinders accordingly. Disk /dev/hda: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

CIS 191 - Lesson 2 Disk sizes (fdisk command) 5 GB VMWare Drive 5

CIS 191 - Lesson 2 Disk sizes (fdisk command) 5 GB VMWare Drive 5 x 1024 = 5, 368, 709, 120 bytes 255 heads x 63 sectors/track x 652 cylinders x 512 bytes = 5, 362, 882, 560 bytes NOTE This is logical (not physical) disk geometry Cylinders Blocks (1 block = 1024 bytes)

CIS 191 - Lesson 2 Disk sizes (df command) 3, 5266, 204 x 1000

CIS 191 - Lesson 2 Disk sizes (df command) 3, 5266, 204 x 1000 x (1000/1024) = 3, 443, 558, 594 bytes = 3. 4 GB 101, 107 x 1000 x (1000/1024) = 98, 737, 304 bytes = 99 MB NOTE: 1 computer KB = 1, 024 bytes (2 to the 10 th power) 1 human KB = 1, 000 bytes

CIS 191 - Lesson 2 Exercise: Partitioning During Installation 1. Create new VM •

CIS 191 - Lesson 2 Exercise: Partitioning During Installation 1. Create new VM • Configuration: Typical • Guest OS: Linux, Version: Red Hat Linux • VM name: rh 9, Location: See whiteboard • Network connection: Bridged • Disk size: 5 GB, don’t allocate space now 2. CD: Use ISO image: rh 9 -shrike-cd 1. iso 3. Install Red Hat • Installation type: Workstation

CIS 191 - Lesson 2 Exercise: Partitioning During Installation (continued) 4. Disk Partitioning Setup:

CIS 191 - Lesson 2 Exercise: Partitioning During Installation (continued) 4. Disk Partitioning Setup: • Manually partition with Disk Druid • /boot (100 MB) force primary • / (2500 MB) force primary • swap (256 MB) force primary • /home (1000 MB) extended

CIS 191 - Lesson 2 Exercise: Partitioning During Installation (continued) 5. Network Devices: •

CIS 191 - Lesson 2 Exercise: Partitioning During Installation (continued) 5. Network Devices: • DHCP • Hostname: rh 9

CIS 191 - Lesson 2 Exercise: Partitioning During Installation (continued) 5. Firewall: • Medium

CIS 191 - Lesson 2 Exercise: Partitioning During Installation (continued) 5. Firewall: • Medium • Trusted: eth 0 (checked) • Allow incoming: SSH (checked), DHCP (checked) 6. Time zone: Los Angeles 7. Set root password: see whiteboard 8. Customize the set of packages: • Text-based Internet: remove check • Office/Productivity: remove check • Sound and Video: remove check • Graphics: remove check • Games and Entertainment: remove check 9. Don't make emergency floppy

CIS 191 - Lesson 2 Exercise: Partitioning During Installation (continued) 10. Normal user: cis

CIS 191 - Lesson 2 Exercise: Partitioning During Installation (continued) 10. Normal user: cis 191 and password: see whiteboard 11. Don’t register the system 12. Log in and Install VMware Tools • Install RPM • vmware-config-tools. pl • 800 x 600 11. Shut down VM 12. Snapshot VM 13. Add a floppy drive (if necessary) 14. Add a second SCSI drive (2 GB, don't allocate space now)

CIS 191 - Lesson 2 Disk Partitions

CIS 191 - Lesson 2 Disk Partitions

CIS 191 - Lesson 2 Setting up Hard Drives Step 1 – Add hard

CIS 191 - Lesson 2 Setting up Hard Drives Step 1 – Add hard drive to computer Add the hard drive: Free Space • Low-level formatting has already been done at the factory (lays out the physical tracks and sectors). • There are no partitions yet. • There are no file systems yet. Note: Floppies, unlike hard drives, can be low-level formatted with the fdformat command

CIS 191 - Lesson 2 Setting up Hard Drives Step 2 - Partition the

CIS 191 - Lesson 2 Setting up Hard Drives Step 2 - Partition the hard drive Master Boot Record (MBR) Partition Boot Sector Data Partition the hard drive: • The MBR is on the very first sector and is 512 bytes long. Partition Boot Sector • The first 446 bytes of the MBR gets system boot code. Data • The next 64 bytes of the MBR gets the partition table. • The last 2 bytes are marked 0 x. AA 55. Free Space

CIS 191 - Lesson 2 Setting up Hard Drives Step 2 - Partition the

CIS 191 - Lesson 2 Setting up Hard Drives Step 2 - Partition the hard drive Master Boot Record (MBR) Partition Boot Sector Data Primary partition The MBR partition table records the location, status and type of each primary partition. Partition Boot Sector Data Primary partition Free Space Each added partition has its own boot sector at the beginning.

CIS 191 - Lesson 2 Setting up Hard Drives Step 2 - Partition the

CIS 191 - Lesson 2 Setting up Hard Drives Step 2 - Partition the hard drive Master Boot Record (MBR) Partition Boot Sector Data Primary partition The maximum number of primary partitions is four.

CIS 191 - Lesson 2 Setting up Hard Drives Step 2 - Partition the

CIS 191 - Lesson 2 Setting up Hard Drives Step 2 - Partition the hard drive Master Boot Record (MBR) One of the four primary partitions can be an extended partition Partition Boot Sector An extended may contain an arbitrary number of logical partitions Partition Boot Sector Data Primary partition Partition Boot Sector Logical partition Unused Boot Sector Data Extended partition

CIS 191 - Lesson 2 Setting up Hard Drives Step 3 – Add file

CIS 191 - Lesson 2 Setting up Hard Drives Step 3 – Add file systems to partitions Master Boot Record (MBR) Partition Boot Sector Data Partition Boot Sector ext 2 file system Superblock Inode Table Data Partition Boot Sector Unused Boot Sector Data Blocks

CIS 191 - Lesson 2 fdisk and mount Show current partitions and their usage

CIS 191 - Lesson 2 fdisk and mount Show current partitions and their usage Master Boot Record (MBR) Partition Boot Sector /dev/sda 1 /boot Partition Boot Sector /dev/sda 2 / Partition Boot Sector /dev/sda 3 swap Partition Boot Sector /dev/sda 4 Unused Boot Sector /home Free Space /dev/sda 5

CIS 191 - Lesson 2 Specifying partitions Partitions are labeled by Linux as the

CIS 191 - Lesson 2 Specifying partitions Partitions are labeled by Linux as the drive name following by a number. The numbers 1 -4 are reserved for the first four primary partitions. 5 or higher indicates it is a logical partition. Examples: /dev/hda 1 = first partition (primary) on the primary master IDE drive. /dev/sdb 3 = third partition (primary) on the second SCSI drive. /dev/sda 5 = fifth partition (logical partition) on the first SCSI drive.

CIS 191 – Lesson 2 Specifying partitions Add 1 primary and 1 extended to

CIS 191 – Lesson 2 Specifying partitions Add 1 primary and 1 extended to new drive [root@rh 9 root]# fdisk -l Disk /dev/sda: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes /dev/sda has been partitioned already. Device Boot /dev/sda 1 * /dev/sda 2 /dev/sda 3 /dev/sda 4 /dev/sda 5 /dev/sda 6 Start 1 14 333 366 493 End 13 332 365 652 492 505 Blocks 104391 2562367+ 265072+ 2305327+ 1020096 104391 Id 83 83 82 5 83 83 System Linux swap Extended Linux Disk /dev/sdb: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes /dev/sdb has not been partitioned yet. Disk /dev/sdb doesn't contain a valid partition table [root@rh 9 root]# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0 x 0000 of partition table 4 will be corrected by w(rite) Command (m for help):

CIS 191 – Lesson 2 Specifying partitions Add 1 primary and 1 extended to

CIS 191 – Lesson 2 Specifying partitions Add 1 primary and 1 extended to new drive db /s ev Unused 5 Boot Sector /d /dev/sdb 1 MBR Free Command (m for help): n Command action e extended p primary partition (1 -4) e Partition number (1 -4): 1 First cylinder (1 -261, default 1): 1 Last cylinder or +size. M or +size. K (1 -261, default 261): 50 Command (m for help): n Command action l logical (5 or over) p primary partition (1 -4) l First cylinder (1 -50, default 1): Using default value 1 Last cylinder or +size. M or +size. K (1 -50, default 50): 10 Command (m for help): p Disk /dev/sdb: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Note: The second partition added is number 5 because it is in an extended partition. Numbers 1 -4 are reserved for the four primary partitions. Device Boot /dev/sdb 1 /dev/sdb 5 Start 1 1 Command (m for help): End 50 10 Blocks 401593+ 80262 Id 5 83 System Extended Linux

CIS 191 - Lesson 2 fdisk Partition Utility – (n)ew and (p)rint ev /s

CIS 191 - Lesson 2 fdisk Partition Utility – (n)ew and (p)rint ev /s da 3 /d 5 da /s ev Free Space Command (m for help): n First cylinder (493 -652, default 493): Using default value 493 Last cylinder or +size. M or +size. K (493 -652, default 652): +100 M Command (m for help): p Disk /dev/sda: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot /dev/sda 1 * /dev/sda 2 /dev/sda 3 /dev/sda 4 /dev/sda 5 /dev/sda 6 Start 1 14 333 366 493 da /s Unused /d /home ev Unused /d /dev/sda 4 Boot Sector 6 swap ev Boot Sector /d / /s da 2 /boot Boot Sector [root@rh 9 root]# fdisk /dev/sda da /s ev /d Boot Sector 1 MBR Command (m for help): End 13 332 365 652 492 505 Blocks 104391 2562367+ 265072+ 2305327+ 1020096 104391 Id 83 83 82 5 83 83 System Linux swap Extended Linux

CIS 191 - Lesson 2 fdisk Partition Utility – (m)enu of commands da /s

CIS 191 - Lesson 2 fdisk Partition Utility – (m)enu of commands da /s ev /d Boot Sector 1 MBR ev da 3 /d 5 da /s ev da /s Unused /d /home ev Unused /d /dev/sda 4 Boot Sector Free Space 6 swap /s Boot Sector ev / /d Boot Sector /s da 2 /boot Command (m for help): m Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help):

CIS 191 - Lesson 2 fdisk Partition Utility – (w)rite out partition table da

CIS 191 - Lesson 2 fdisk Partition Utility – (w)rite out partition table da /s ev ev da 3 /d 5 da /s ev da /s Unused /d /home ev Unused /d /dev/sda 4 Boot Sector Free Space 6 swap /s Boot Sector ev / WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. [root@rh 9 root]# partprobe /d Boot Sector /s da 2 /boot Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. /d Boot Sector 1 MBR Use partprobe to update the kernel without rebooting. This is required if you want to mount a new partition.

CIS 191 - Lesson 2 fdisk Partition Utility – the l option da /s

CIS 191 - Lesson 2 fdisk Partition Utility – the l option da /s ev /d Boot Sector 1 MBR ev da 3 /d 5 da /s ev da /s Unused /d /home ev Unused /d /dev/sda 4 Boot Sector Free Space 6 swap /s Boot Sector ev / /d Boot Sector /s da 2 /boot [root@rh 9 root]# fdisk -l Disk /dev/sda: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot /dev/sda 1 * /dev/sda 2 /dev/sda 3 /dev/sda 4 /dev/sda 5 /dev/sda 6 Start 1 14 333 366 493 End 13 332 365 652 492 505 Blocks 104391 2562367+ 265072+ 2305327+ 1020096 104391 Id 83 83 82 5 83 83 System Linux swap Extended Linux

CIS 191 - Lesson 2 Exercise: Partitioning with fdisk 1. On the rh 9

CIS 191 - Lesson 2 Exercise: Partitioning with fdisk 1. On the rh 9 VM, use fdisk –l to show your hard drive and the current partitions. 2. Now run fdisk on your hard drive 3. Add a new 100 M partition to /dev/sda. 4. Type p to verify. 5. Delete the partition you just added and verify. 6. Add the partition back in again and verify. 7. Change the system ID of the new partition to Amoeba and verify. 8. Change it back to Linux and verify. 9. Type W to write out partition table and exit. 10. Type partprobe to update the kernel without rebooting. 11. Run fdisk –l to show your hard drive and the updated partitions. 12. Check: Your new partition should be /dev/sda 6

CIS 191 - Lesson 2 Making File Systems

CIS 191 - Lesson 2 Making File Systems

CIS 191 - Lesson 2 dd command (continued) Reading and writing directly to a

CIS 191 - Lesson 2 dd command (continued) Reading and writing directly to a drive [root@rh 9 root]# fdisk -l Disk /dev/sda: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot /dev/sda 1 * /dev/sda 2 /dev/sda 3 /dev/sda 4 /dev/sda 5 /dev/sda 6 Start 1 14 333 366 493 End 13 332 365 652 492 505 Blocks 104391 2562367+ 265072+ 2305327+ 1020096 104391 Id 83 83 82 5 83 83 Disk /dev/sdb: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes System Linux swap Extended Linux /dev/sdb is a newly added un-partitioned drive Disk /dev/sdb doesn't contain a valid partition table [root@rh 9 root]# echo "Rich was here" > /dev/sdb [root@rh 9 root]# xxd /dev/sdb | more 0000000: 5269 6368 2077 6173 2068 6572 650 a 0000 Rich was here. . . 0000010: 0000 0000. . . . < snipped >. . . . 0000150: 0000 0000. . . . [root@rh 9 root]# You can write and read to the drive however it is very clumsy compared to using a file system* *Never do this to a drive containing important data

CIS 191 - Lesson 2 dd command (continued) Reading and writing directly to a

CIS 191 - Lesson 2 dd command (continued) Reading and writing directly to a partition /dev/sdb 6 is a newly added, un-mounted partition on /dev/sda [root@rh 9 root]# echo "Rich was here too" > test [root@rh 9 root]# wc -c test 18 test [root@rh 9 root]# dd if=test of=/dev/sda 6 bs=1 count=18 18+0 records in 18+0 records out [root@rh 9 root]# dd if=/dev/sda 6 bs=1 count=18 Rich was here too 18+0 records in 18+0 records out [root@rh 9 root]# xxd /dev/sda 6 | more 0000000: 5269 6368 2077 6173 2068 6572 6520 746 f Rich was here to 0000010: 6 f 0 a 0000 0000 o. . . . 0000020: 0000 0000. . . . < snipped > [root@rh 9 root]# dd if=/dev/zero of=/dev/sda 6 bs=1 count=18 18+0 records in 18+0 records out [root@rh 9 root]# xxd /dev/sda 6 | more 0000000: 0000 0000. . . . 0000010: 0000 0000. . . . < snipped > We can also write and read directly to the partition. * /dev/zero has an unlimited numbers of binary zeros. Can be used to zero out a partition or drive. * *Never do this to a partition containing important data

CIS 191 - Lesson 2 Adding File Systems Superblock Inode Table Data Blocks Analogy:

CIS 191 - Lesson 2 Adding File Systems Superblock Inode Table Data Blocks Analogy: making a file system on an empty partition is like painting the stripes on a parking lot. It organizes the space and makes it efficient. ext 2 file system

CIS 191 - Lesson 2 Adding File Systems da /s mkfs –t ext 2

CIS 191 - Lesson 2 Adding File Systems da /s mkfs –t ext 2 /dev/sda 6 ev /d Boot Sector 1 MBR Superblock swap ev da 3 /d /s Boot Sector ev / 5 da /s Free Space da 6 ev /d /s Unused ev /home /d /dev/sda 4 Boot Sector Unused Inode Table /d Boot Sector /s da 2 /boot Data Blocks

CIS 191 - Lesson 2 mkfs command mkfs –t -t -t -t type device

CIS 191 - Lesson 2 mkfs command mkfs –t -t -t -t type device ext 2 ext 3 (has journaling) vfat (compatible with Windows) jfs (IBM’s journaled file system) reiserfs For ext 2 or ext 3 use: -N option to specify number of inodes -m option to specify % blocks reserved for superuser (default 5%) -L option to set the volume label for the file system Example: mkfs –t ext 3 /dev/sda 6 (puts ext 3 file system on 6 th partition of 1 st SCSI drive) Example: mkfs –t ext 2 –m 0 –N 1000 –L myfiles /dev/sda 6 (puts ext 2 file system with 1000 inodes, no space reserved for superuser, volume label “myfiles” on 6 th partition of 1 st SCSI drive, ) Note: mkfs is actually a front end for various file systems builders. [root@rh 9 root]# ls /sbin/mkfs* /sbin/mkfs. ext 2 /sbin/mkfs. cramfs /sbin/mkfs. ext 3 /sbin/mkfs. jfs /sbin/mkfs. msdos /sbin/mkfs. reiserfs /sbin/mkfs. vfat

CIS 191 - Lesson 2 File Systems FAT 32 file system [root@partide root]# fdisk

CIS 191 - Lesson 2 File Systems FAT 32 file system [root@partide root]# fdisk -l /dev/sda Disk /dev/sda: 999 MB, 999816704 bytes 4 heads, 8 sectors/track, 61023 cylinders Units = cylinders of 32 * 512 = 16384 bytes This pen drive works with Windows or Linux Device Boot Start End Blocks Id System /dev/sda 1 * 1 61024 976379+ b Win 95 FAT 32 [root@partide root]# umount /mnt [root@partide root]# mount /dev/sda 1 /mnt [root@partide root]# ls -l /mnt total 713064 -rwxr-xr-x 1 root 730177536 Mar 23 23: 18 KNOPPIX_V 5. 1. 1 CD-2007 -01 -04 -EN. iso [root@partide root]#

CIS 191 - Lesson 2 ext 2 file system Superblock Inode Table Data Blocks

CIS 191 - Lesson 2 ext 2 file system Superblock Inode Table Data Blocks Superblock has: • File system type, label, inode count, block count, etc. about entire file system. • Redundant copies are maintained. • Use: dumpe 2 fs –h /dev/sda 2 to see / superblock info on rh 9 VM inodes have: • file type, permissions, link count, owner, group, size, major and minor numbers, creation date, modification date, access date, pointers to data blocks. • Does not contain filenames which are kept in directories. • Use stat command to see inode information Data blocks have actual file and directory data.

CIS 191 - Lesson 2 bigfile 102574 bin 102575 letter 102609 inode number -

CIS 191 - Lesson 2 bigfile 102574 bin 102575 letter 102609 inode number - Type rw-r—r-- Permissions 1 Number of links simmsben User cis 90 Group 1044 Size 2001 -07 -20 Modification time 2008 -08 -08 Access Time ext 2 file system Superblock Hello Mother! Hello Father! Here I am at Camp Granada. Things are very entertaining, and they say we'll have some fun when it stops raining. Inode Table All the counselors hate the waiters, and the lake has alligators. You remember Leonard Skinner? He got ptomaine poisoning last night after dinner. Now I don't want this to scare you, but my bunk mate has malaria. You remember Jeffrey Hardy? Their about to organize a searching party. Take me home, oh Mother, Father, take me home! I hate Granada. Don't leave me out in the forest where I might get eaten by a bear! Take me home, I promise that I won't make noise, or mess the house with other boys, oh please don't make me stay -- I've been here one whole day. Data Blocks Dearest Father, darling Mother, how's my precious little brother? I will come home if you miss me. I will even let Aunt Bertha hug and kiss me! Wait a minute! It's stopped hailing! Guys are swimming! Guys are sailing! Playing baseball, gee that's better! Mother, Father, kindly disregard this letter. 2008 -06 -20 Alan Sherman Pointer(s) to data blocks [simmsben@opus ~]$ls -il letter 102609 -rw-r--r-- 1 simmsben cis 90 1044 Jul 20 2001 letter Change time Pointer(s) to data blocks

CIS 191 - Lesson 2 ext 2 file system Using dumpe 2 fs –h

CIS 191 - Lesson 2 ext 2 file system Using dumpe 2 fs –h to show superblock information [root@rh 9 root]# dumpe 2 fs -h /dev/sda 2 dumpe 2 fs 1. 32 (09 -Nov-2002) Filesystem volume name: / Last mounted on: <not available> Filesystem UUID: b 552 eed 8 -4 c 9 d-4 f 8 f-9 edf-dd 76037 f 82 bd Filesystem magic number: 0 x. EF 53 Filesystem revision #: 1 (dynamic) Filesystem features: has_journal filetype needs_recovery sparse_super Default mount options: (none) Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 320640 Block count: 640591 Reserved block count: 32029 Free blocks: 228375 Free inodes: 220820 First block: 0 Block size: 4096 Fragment size: 4096 Blocks per group: 32768 Fragments per group: 32768 Inodes per group: 16032 Inode blocks per group: 501 Filesystem created: Fri Jul 18 09: 37: 33 2008 Last mount time: Fri Jul 18 17: 06: 16 2008 Last write time: Fri Jul 18 17: 06: 16 2008 Mount count: 3 Maximum mount count: -1 Last checked: Fri Jul 18 09: 37: 33 2008 Check interval: 0 (<none>) Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) First inode: 11 Inode size: 128 Journal UUID: <none> Journal inode: 8 Journal device: 0 x 0000 First orphan inode: 229443 [root@rh 9 root]# If you leave off the –h option you will also see the data block status as well.

CIS 191 - Lesson 2 ext 2 file system Using stat command to show

CIS 191 - Lesson 2 ext 2 file system Using stat command to show Inode details [root@rh 9 root]# ls anaconda-ks. cfg install. log. syslog testdir [root@rh 9 root]# ls -l total 36 -rw-r--r-1 root 1220 Jul 18 16: 57 anaconda-ks. cfg -rw-r--r-1 root 19626 Jul 18 16: 51 install. log -rw-r--r-1 root 2895 Jul 18 16: 51 install. log. syslog -rw-r--r-1 root 18 Jul 18 17: 24 test drwxr-xr-x 2 root 4096 Jul 20 18: 41 testdir [root@rh 9 root]# stat testdir File: `test' Size: 18 Blocks: 8 IO Block: 4096 Regular File Device: 802 h/2050 d Inode: 37058 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2008 -07 -20 18: 40: 47. 00000 -0700 Modify: 2008 -07 -18 17: 24: 47. 00000 -0700 Change: 2008 -07 -18 17: 24: 47. 00000 -0700 File: Size: Device: Access: Modify: Change: `testdir' 4096 Blocks: 8 IO Block: 4096 802 h/2050 d Inode: 20964 Links: 2 (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 2008 -07 -20 18: 41: 08. 000000000 -0700 2008 -07 -20 18: 41: 08. 00000 -0700 Directory 0/ root) [root@rh 9 root]# Note: The name of the file is not kept in the Inode. It is kept as data in a directory file.

CIS 191 - Lesson 2 ext 2 file system lost+found directory [root@rh 9 root]#

CIS 191 - Lesson 2 ext 2 file system lost+found directory [root@rh 9 root]# mkfs -t ext 2 /dev/sda 6 mke 2 fs 1. 32 (09 -Nov-2002) Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) 26104 inodes, 104391 blocks 5219 blocks (5. 00%) reserved for the super user First data block=1 13 block groups 8192 blocks per group, 8192 fragments per group 2008 inodes per group Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729 Note: The lost+found directory is created when you make a ext 2 or ext 3 file system. This is where the fsck utility will place any recovered data it finds when checking a file system. Don’t delete it! Writing inode tables: done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 21 mounts or 180 days, whichever comes first. Use tune 2 fs -c or -i to override. [root@rh 9 root]# mount /dev/sda 6 /mnt [root@rh 9 root]# ls /mnt lost+found [root@rh 9 root]# ls -l /mnt total 12 drwx-----2 root 12288 Jul 21 08: 22 lost+found [root@rh 9 root]#

CIS 191 - Lesson 2 Exercise: Make some file systems 1. On the rh

CIS 191 - Lesson 2 Exercise: Make some file systems 1. On the rh 9 VM, use fdisk –l to show your hard drive and the current partitions. 2. Make and re-make file systems on /dev/sda 6: mkfs mkfs –t –t ext 2 /dev/sda 6 ext 3 /dev/sda 6 jfs /dev/sda 6 vfat /dev/sda 6 reiserfs /dev/sda 6 ext 3 –N 9000 –m 10 –L /myfiles /dev/sda 6

CIS 191 - Lesson 2 Mounting File Systems

CIS 191 - Lesson 2 Mounting File Systems

CIS 191 - Lesson 2 Mounting File Systems Mounting and Un-mounting file systems •

CIS 191 - Lesson 2 Mounting File Systems Mounting and Un-mounting file systems • mount [device-file] [directory] • umount [device-file | directory] Mount information 1. /etc/fstab (what to mount at boot time) 2. /etc/mtab (current mount status)

CIS 191 - Lesson 2 Showing current mount status On the rh 9 VM

CIS 191 - Lesson 2 Showing current mount status On the rh 9 VM [root@rh 9 root]# mount /dev/sda 2 on / type ext 3 (rw) none on /proc type proc (rw) /dev/sda 1 on /boot type ext 2 (rw) none on /dev/pts type devpts (rw, gid=5, mode=620) /dev/sda 5 on /home type ext 3 (rw) none on /dev/shm type tmpfs (rw) mount command with no arguments shows current mount status in /etc/mtab [root@rh 9 root]# cat /etc/mtab /dev/sda 2 / ext 3 rw 0 0 none /proc rw 0 0 /dev/sda 1 /boot ext 2 rw 0 0 none /dev/pts devpts rw, gid=5, mode=620 0 0 /dev/sda 5 /home ext 3 rw 0 0 none /dev/shm tmpfs rw 0 0 [root@rh 9 root]# ls -F /home /boot: boot. b kernel. h chain. b lost+found/ config-2. 4. 20 -6 message grub/ message. ja initrd-2. 4. 20 -6. img module-info@ /home: lost+found/ /bin /boot /dev/sda 1 /dev/sda 2 /grub /lost+found /dev/sda 5 /etc /dev/sda 6 /dev /home /mnt module-info-2. 4. 20 -6 os 2_d. b System. map@ System. map-2. 4. 20 -6 vmlinux-2. 4. 20 -6 / vmlinuz@ vmlinuz-2. 4. 20 -6 /rsimms /lost+found /mnt rsimms/ /mnt: cdrom/ floppy/ hgfs/ [root@rh 9 root]# /cdrom /floppy /hgfs

CIS 191 - Lesson 2 Making a file system and mounting it On the

CIS 191 - Lesson 2 Making a file system and mounting it On the rh 9 VM [root@rh 9 root]# mkfs -t ext 3 /dev/sda 6 mke 2 fs 1. 32 (09 -Nov-2002) Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) 26104 inodes, 104391 blocks 5219 blocks (5. 00%) reserved for the super user First data block=1 13 block groups 8192 blocks per group, 8192 fragments per group 2008 inodes per group Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729 Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done / /bin /boot /dev/sda 1 /dev/sda 2 /grub /lost+found /dev/sda 5 /etc /dev/sda 6 /dev This filesystem will be automatically checked every 39 mounts or 180 days, whichever comes first. Use tune 2 fs -c or -i to override. [root@rh 9 root]# mount /dev/sda 6 /mnt [root@rh 9 root]# cd /mnt [root@rh 9 mnt]# mkdir 1 dir 2 [root@rh 9 mnt]# ls dir 1 dir 2 lost+found mount will overlay the [root@rh 9 mnt]# cd new files ystem on a [root@rh 9 root]# ls /mnt directory in the current dir 1 dir 2 lost+found file hierarchy. The old [root@rh 9 root]# umount /mnt directory is no longer [root@rh 9 root]# ls /mnt cdrom floppy hgfs accessible until the new [root@rh 9 root]# one is un-mounted /home /rsimms /lost+found /mnt /dir 1 /fdir 2 /lost+found

Mounting File Systems Like pinning the tail on the donkey mount /dev/sda 6 /mnt

Mounting File Systems Like pinning the tail on the donkey mount /dev/sda 6 /mnt / /bin /boot /etc /lost+found /grub /dev/sda 1 /dev /home /lib /mnt /lost+found /cdrom /rsimms /floppy /dev/sda 5 /hgfs /dir 1 /fdir 2 /lost+found /dev/sda 6

Mounting File Systems Like pinning the tail on the donkey mount /dev/sda 6 /mnt

Mounting File Systems Like pinning the tail on the donkey mount /dev/sda 6 /mnt / /bin /boot /etc /lost+found /grub /dev/sda 1 /dev /home /lib /mnt /lost+found /dir 1 /rsimms /dir 2 /dev/sda 5 /lost+found /dev/sda 6

Mounting File Systems Caveats • Don’t mount a file system to a directory you

Mounting File Systems Caveats • Don’t mount a file system to a directory you are in. • You can’t un-mount a file system you have cd’ed into: [root@rh 9 mnt]# umount /mnt umount: /mnt: device is busy [root@rh 9 mnt]# cd [root@rh 9 root]# umount /mnt [root@rh 9 root]#

CIS 191 - Lesson 2 Mounting File Systems mount command /etc/mtab device mount point

CIS 191 - Lesson 2 Mounting File Systems mount command /etc/mtab device mount point [root@rh 9 root]# mount /dev/sda 2 on / none on /proc /dev/sda 1 on /boot none on /dev/pts /dev/sda 5 on /home none on /dev/shm [root@rh 9 root]# cat /dev/sda 2 / none /proc /dev/sda 1 /boot none /dev/pts /dev/sda 5 /home none /dev/shm [root@rh 9 root]# file system type type ext 3 proc ext 2 devpts ext 3 tmpfs /etc/mtab ext 3 proc ext 2 devpts ext 3 tmpfs mount options dump frequency fsck pass (rw) (rw, gid=5, mode=620) (rw) rw rw, gid=5, mode=620 rw rw Note: spaces added to output above for readability 0 0 0

CIS 191 - Lesson 2 Mounting File Systems /etc/fstab is used to automatically mount

CIS 191 - Lesson 2 Mounting File Systems /etc/fstab is used to automatically mount file systems at boot time [root@rh 9 root]# cat /etc/fstab mount point device LABEL=/boot none LABEL=/home none /dev/sda 3 /dev/cdrom /dev/fd 0 / /boot /dev/pts /home /proc /dev/shm swap /mnt/cdrom /mnt/floppy file system type ext 3 ext 2 devpts ext 3 proc tmpfs swap udf, iso 9660 auto mount options dump frequency defaults gid=5, mode=620 defaults noauto, owner, kudzu, ro noauto, owner, kudzu Note: spacing modified in output above for readability fsck pass 1 1 0 0 0 1 2 0 0 0

CIS 191 - Lesson 2 Swap Space /etc/fstab is used to automatically mount file

CIS 191 - Lesson 2 Swap Space /etc/fstab is used to automatically mount file systems at boot time [root@rh 9 root]# cat /etc/fstab mount point device LABEL=/boot none LABEL=/home none /dev/sda 3 /dev/cdrom /dev/fd 0 / /boot /dev/pts /home /proc /dev/shm swap /mnt/cdrom /mnt/floppy file system type ext 3 ext 2 devpts ext 3 proc tmpfs swap udf, iso 9660 auto mount options dump frequency defaults gid=5, mode=620 defaults noauto, owner, kudzu, ro noauto, owner, kudzu Note: spacing modified in output above for readability fsck pass 1 1 0 0 0 1 2 0 0 0

CIS 191 - Lesson 2 File Types

CIS 191 - Lesson 2 File Types

CIS 191 – Lesson 2 File Types and Commands Long listing code (ls –l)

CIS 191 – Lesson 2 File Types and Commands Long listing code (ls –l) Type How to make one d directory mkdir - regular touch l symbolic link ln -s c special (character, unbuffered) mknod b special (block, buffered) mknod Note: Other files types includes sockets (s) and named piped (p) Note: Leverage existing device files when making new special files to get correct major and minor numbers.

CIS 191 – Lesson 2 File Types and Commands Long listing code (ls –l)

CIS 191 – Lesson 2 File Types and Commands Long listing code (ls –l) Type How to make one d directory mkdir - regular touch l symbolic link ln -s c special (character, unbuffered) mknod b special (block, buffered) mknod

CIS 191 - Lesson 2 Exercise: Putting it all together: • Add a partition

CIS 191 - Lesson 2 Exercise: Putting it all together: • Add a partition to the new second drive on the rh 9 VM. • Make a ext 3 file system on it. • Make a starter root file system.

CIS 191 - Lesson 2 Everything now Show current drives and partitions [root@rh 9

CIS 191 - Lesson 2 Everything now Show current drives and partitions [root@rh 9 root]# fdisk -l Disk /dev/sda: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot /dev/sda 1 * /dev/sda 2 /dev/sda 3 /dev/sda 4 /dev/sda 5 /dev/sda 6 Start 1 14 333 366 493 End 13 332 365 652 492 505 Blocks 104391 2562367+ 265072+ 2305327+ 1020096 104391 Id 83 83 82 5 83 83 System Linux swap Extended Linux Disk /dev/sdb: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn't contain a valid partition table [root@rh 9 root]#

CIS 191 - Lesson 2 Everything now Add a partition to the new drive

CIS 191 - Lesson 2 Everything now Add a partition to the new drive [root@rh 9 root]# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0 x 0000 of partition table 4 will be corrected by w(rite) Command (m for help): n Command action e extended p primary partition (1 -4) p Partition number (1 -4): 1 First cylinder (1 -261, default 1): Using default value 1 Last cylinder or +size. M or +size. K (1 -261, default 261): 50 Command (m for help):

CIS 191 - Lesson 2 Everything now Update partition table and kernel Command (m

CIS 191 - Lesson 2 Everything now Update partition table and kernel Command (m for help): p Disk /dev/sdb: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot /dev/sdb 1 Start 1 End 50 Blocks 401593+ Id 83 System Linux Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. [root@rh 9 root]# partprobe

CIS 191 - Lesson 2 Everything now Make a ext 3 filesystem on the

CIS 191 - Lesson 2 Everything now Make a ext 3 filesystem on the new partition [root@rh 9 root]# mkfs -t ext 3 /dev/sdb 1 mke 2 fs 1. 32 (09 -Nov-2002) warning: 184 blocks unused. Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) 100744 inodes, 401409 blocks 20079 blocks (5. 00%) reserved for the super user First data block=1 49 block groups 8192 blocks per group, 8192 fragments per group 2056 inodes per group Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729, 204801, 221185 Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 26 mounts or 180 days, whichever comes first. Use tune 2 fs -c or -i to override. [root@rh 9 root

CIS 191 - Lesson 2 Everything now Make a starter root file system [root@rh

CIS 191 - Lesson 2 Everything now Make a starter root file system [root@rh 9 root]# mount /dev/sdb 1 /mnt [root@rh 9 root]# ls /mnt lost+found [root@rh 9 root]# cd /mnt [root@rh 9 mnt]# mkdir bin dev lib [root@rh 9 mnt]# cd bin [root@rh 9 bin]# cp /bin/bash. [root@rh 9 bin]# ln -s bash sh [root@rh 9 bin]# cd. . /lib [root@rh 9 lib]# ldd /bin/bash libtermcap. so. 2 => /libtermcap. so. 2 (0 x 40025000) libdl. so. 2 => /libdl. so. 2 (0 x 40029000) libc. so. 6 => /lib/tls/libc. so. 6 (0 x 42000000) /lib/ld-linux. so. 2 => /lib/ld-linux. so. 2 (0 x 40000000) [root@rh 9 lib]# cp /libtermcap. so. 2. [root@rh 9 lib]# cp /libdl. so. 2. [root@rh 9 lib]# cp /lib/tls/libc. so. 6. [root@rh 9 lib]# cp /lib/ld-linux. so. 2. [root@rh 9 lib]# cd. . /dev [root@rh 9 dev]# ls -l /dev/console crw------1 root 5, 1 Jul 21 07: 00 /dev/console [root@rh 9 dev]# mknod console c 5 1 [root@rh 9 dev]# ls -l /dev/sda 1 brw-rw---1 root disk 8, 0 Jan 30 2003 /dev/sda brw-rw---1 root disk 8, 1 Jan 30 2003 /dev/sda 1 [root@rh 9 dev]# mknod sda b 8 0 [root@rh 9 dev]# mknod sda 1 b 8 1

CIS 191 - Lesson 2 Everything now Make a root filesystem on /dev/sdb 1

CIS 191 - Lesson 2 Everything now Make a root filesystem on /dev/sdb 1 [root@rh 9 mnt]#. : total 15 drwxr-xr-x 2 drwx-----2 ls -l. R root root . /bin: total 616 -rwxr-xr-x lrwxrwxrwx 1 root 626028 Jul 21 15: 24 bash 4 Jul 21 16: 13 sh -> bash . /dev: total 0 crw-r--r-brw-r--r-- 1 root root 5, 8, 8, . /lib: total 1651 -rwxr-xr-x 1 1 root . /lost+found: total 0 [root@rh 9 mnt]# root 1024 12288 Jul Jul 21 21 15: 24 15: 27 15: 25 15: 12 bin dev lib lost+found 1 Jul 21 15: 26 console 0 Jul 21 15: 27 sda 1 105300 1547996 14952 11784 Jul Jul 21 21 15: 25 ld-linux. so. 2 libc. so. 6 libdl. so. 2 libtermcap. so. 2

CIS 191 - Lesson 2 New Commands and files

CIS 191 - Lesson 2 New Commands and files

CIS 191 - Lesson 2 New commands: dumpe 2 fs fdisk mknod ldd ln

CIS 191 - Lesson 2 New commands: dumpe 2 fs fdisk mknod ldd ln –s fdformat mkfs mount stat umount xxd - show overall file system information hard drive partition utility creates special device files show libraries used by a binary program creates symbolic (soft) links formats a floppy disk makes file systems mounts file systems shows file information un-mounts file systems displays binary data in hexadecimal format New Files and Directories: /dev /etc/fstab /etc/mtab VMware: vmware-config-tools. pl - must be run to finish installing these tools

CIS 191 – Lesson 2 Next Class Assignment: Check Calendar Page on web site

CIS 191 – Lesson 2 Next Class Assignment: Check Calendar Page on web site to see what is due next week. Quiz questions for next class: • What device name would you use to specify the fifth partition on the second SCSI drive? • What command could be used to put a ext 3 file system on /dev/sda 6? • What is the maximum number of primary partitions a drive can have?

CIS 191 – Lesson 2 Backup

CIS 191 – Lesson 2 Backup

Some commands Add ssh server access to Ubuntu: sudo aptitude update sudo aptitude install

Some commands Add ssh server access to Ubuntu: sudo aptitude update sudo aptitude install openssh-server List of top level directories sorted by size: du –s /* 2> /dev/null | sort -g