sys admin course physical storage and file systems fourie joubert

25
Sys Admin Course Physical Storage and File Systems Fourie Joubert

Upload: adele-simpson

Post on 02-Jan-2016

231 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

Physical Storage and File Systems

Fourie Joubert

Page 2: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

Physical Storage

• Physical disks may be inside the server, or in an external enclosure

• The server may also be connected to storage in other ways, such as on a network

Page 3: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• The physical disks may have platters, or be SSD

Page 4: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• The disks may have different speeds• Seeks times vary from around 4ms to 15 ms• Latencies:

Page 5: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• There are different types of disk interfaces– IDE (deprecated)– SCSI (mostly deprecated)– SATA– SAS– FC

Page 6: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• Interface speeds– Vary from around 1Gbps to around 6Gbps

Page 7: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• Connections to external disk enclosures– SAS– iSCSI– FC

Page 8: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• Physical storage devices in Linux– /dev/sda– /dev/sdb– /dev/sdc

• Partitions on the disks– /dev/sda1– /dev/sda2– …

Page 9: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• RAID– Redundant Array of Independent Disks

• RAID levels– RAID 0: Striping– RAID 1: Mirroring– RAID 2: Bit-level striping with dedicated Hamming-

code parity– RAID 3: Byte level striping with dedicated parity– RAID 4: Block level striping with dedicated parity– RAID 5: Block level striping with distributed parity– RAID 6: Block level striping with double distributed

parity

Page 10: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• Nested RAID– RAID 0 + 1: creates a second striped set to mirror a

primary striped set– RAID 1 + 0: creates a striped set from a series of

mirrored drives

Page 11: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• Hardware vs software RAID– Hardware RAID: the interface card has a dedicated

setup system• Software RAID– Managed by the operating system– mdraid (preferred)– dmraid (user space)

Page 12: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

Working with the partition table

• partedparted /dev/sda> print

Page 13: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

> mklabel type> mklabel gpt

> mkpart part-type fs-type start end

> rm number

> toggle number flag

Page 14: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• gparted

Page 15: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

Filesystems• ext2 (old)• ext3 (old-ish)• fat16 (old win)• fat32 (old win)• hfs (apple)• jfs (IBM journalled)• linux-swap (swap)• ntfs (win)• reiserfs (old-ish)• hp-ufs (HP)• sun-ufs (Sun)• xfs (Silicon Graphics)• btrfs(btree)

Page 16: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• mkfs – create a file systemmkfs –t ext4 /dev/sda3• e2label – label an e-filesysteme2label /dev/sda3 /work

Page 17: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• The file system tableblkid –o list• You will get a list of your block devices, with

their /devs, labels, mount points and UUIDs

Page 18: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• Looking at the fstabless /etc/fstab• 1: column is the mount id• 2: mount point (directory)• 3: fs type• 4: additional options• 5: dump options• 6: filesystem check order

Page 19: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• Mounting a device manuallymount /dev/sda1

• ormount /home

Page 20: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• Allowing users to do mounts• FUSE: Filesystem in user space

Page 21: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

• Checking a filesystemumount /homefsck.ext4 /dev/sda2fsck.ext4 –y /dev/sda2

Checking a filesystem• Repairing a filesystem

fsck –p /dev/sda2

Page 22: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

GUI Mode filesystem operations

• Applications -> System Tools -> Disk Utility

Page 23: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

More complex configurations

• Cluster file systems• Aggregate many devices under a single name

space

Page 24: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course

Page 25: Sys Admin Course Physical Storage and File Systems Fourie Joubert

Sys Admin Course