CT320: Network and System Administration

Fall 2019

Storage

Show Lecture.Storage as a slide show.

CT320 Storage

CT 320: Network and System Administration

Colorado State University

Computer Science Department

Original slides from Dr. James Walden at Northern Kentucky University.

Topics

  1. Disk interfaces
  2. Disk components
  3. Performance
  4. Reliability
  5. RAID
  6. Adding a disk
  7. Logical volumes
  8. Filesystems

Disk Interfaces

SCSI

IDE

SATA vs. SCSI

Hard Drive Components

Hard Drive Components

Disk Information: hdparm

    # hdparm -i /dev/sda1

    /dev/sda1:

     Model=Hitachi HTS543216L9A300, FwRev=FB2OC40C, SerialNo=081107FB2232LCHTGKLA
     Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
     RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
     BuffType=DualPortCache, BuffSize=7114kB, MaxMultSect=16, MultSect=16
     CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=312581808
     IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
     PIO modes:  pio0 pio1 pio2 pio3 pio4
     DMA modes:  mdma0 mdma1 mdma2
     UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6
     AdvancedPM=yes: mode=0x80 (128) WriteCache=enabled
     Drive conforms to: unknown:  ATA/ATAPI-2,3,4,5,6,7

     * signifies the current active mode

Disk Performance

Latency vs. Throughput

Disk Performance: hdparm

    # hdparm -tT /dev/sda1

    /dev/sda1:
     Timing cached reads:   1256 MB in  2.00 seconds = 627.87 MB/sec
     Timing buffered disk reads: 172 MB in  3.02 seconds =  57.00 MB/sec

Reliability

made at imgflip.com

RAID

RAID Levels

Redundancy

Adding a Disk

When don’t you need a filesystem?

    mkswap -v /dev/sdb1

Logical Volumes

LVM

Logical Volume Manager

LVM Components

Mapping Modes

Setting up an LVG and LV

    # pvcreate /dev/hda1
    # pvcreate /dev/hdb1
    vgcreate nku_proj /dev/hda1 /dev/hdb1
Use vgextend to add more PVs later.
    lvcreate -n nku1 --size 100G nku_proj1
    mkfs -v -t ext3 /dev/nku_proj/nku1

Extending a LV

    lvextend -L120G /dev/nku_proj/nku1
    lvextend -L+20G /dev/nku_proj/nku1
    ext2online -v /dev/nku_proj/nku1
    df -h

Swap

    dd if=/dev/zero of=/swapfile bs=1024k count=512
    mkswap /swapfile
    swapon /swapfile
    swapon /dev/sda2
    swapoff /swapfile
    swapoff /dev/sda2
    cat /proc/swaps

Filesystems

    tune2fs -j /dev/sda1

2038

$ perl -wle 'print 0x7fffffff'
2147483647
$ date -d 'january 1, 1970 + 2147483647 seconds'
Tue Jan 19 03:14:07 MST 2038

You probably don’t remember January 1st, 2000, but you sure will remember January 19, 2038.

Other Filesystems

Mounting

    # mount /dev/sda1 /mnt
    # df -h /mnt

fstab

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>

UUID=77f85028-b4c1-4439-be1c-5a3ba7f59dd1  /       ext3  defaults 0 1
LABEL=windows                              /win    vfat  user,rw  0 0
/dev/hdc8                                  /home   ext3  defaults 0 2
/dev/hdc7                                  none    swap  sw       0 0
proc                                       /proc   proc  defaults 0 0

/etc/fstab first field

The first field of an /etc/fstab can be:

fsck: check + repair fs

Lots of filesystem flavors

$ cd /sbin

$ ls -F mkfs.*
mkfs.cramfs*  mkfs.ext3*  mkfs.fat*    mkfs.msdos@  mkfs.vfat@
mkfs.ext2*    mkfs.ext4*  mkfs.minix*  mkfs.ntfs@   mkfs.xfs*

$ ls -F fsck.*
fsck.cramfs*  fsck.ext3*  fsck.fat*    fsck.msdos@  fsck.vfat@
fsck.ext2*    fsck.ext4*  fsck.minix*  fsck.ntfs@   fsck.xfs*

$ ls -F mount.*
mount.cifs*   mount.glusterfs*	 mount.nfs4@	 mount.ntfs-fuse@
mount.fuse*   mount.lowntfs-3g@  mount.ntfs@	 mount.smb3@
mount.fuse3*  mount.nfs*	 mount.ntfs-3g@

References