RH133 Unit 7 Advanced Filesystem Management

Objectives
Upon completion of this unit, you should be able to:
- Setup filesystem quotas
- Setup and manage software raid devices
- Configure logical volumes
- Setup LVM snapshots
- Perform backups
Configuring the Quota System
1) Overview
- Implemented within the kernel
- Enable on a per-filesystems basis
- Individual policies for groups or users
- Limit by the number of blocks or inodes
- Implement both soft and hard limits
2) Initialization
- Partition mount options: usrquota, grpquota
- Initialize database: quotacheck
Setting Quota for Users
1) Implementation
- Start or stop quotas: quotaon, quotaoff
- Edit quotas directly: edquota username
- From a shell:
setquota username 4096 5120 40 50 /foo
- Define prototypical users:
edquota –p user1 user2
Reporting Quota Status
1) Reporting
- User inspection: quota
- Quota overviews: repquota
- Miscellaneous utilities: warnquota
What is Software RAID
1) Multiple disks grouped together into “array” to provide better performance, redundancy or both
2) mdadm – provides the administration interface to software RAID
3) Many “RAID Levels” supported, including RAID 0, 1 and 5
4) Spare disks add extra redundancy
5) RAID devices are named, /dev/md0, /dev/md1, /dev/md2, /dev/md3 and so on
Software RAID Configuration
1) Create and define RAID devices using mdadm
mdadm –C /dev/md0 –a yes –l 1 –n 2 –x 1 /dev/sda1 /dev/sdb1 /dev/sdc1
2) Format each RAID device with a filesystem
mke2fs –j /dev/md0
3) Test the RAID devices
4) mdadm allows you to check the status of you RAID devices
mdadm –detail /dev/md0
Software RAID Testing and Recovery
1) Simulating disk failures
mdadm /dev/md0 –f /dev/sda1
2) Recovering from a software RAID disk failure
- replace the failed hard drive and power on
- reconstruct partitions on the replacement drive
- mdadm /dev/md0 –a /dev/sda1
3) mdadm, /proc/mdstat, and syslog messages
What is Logical Volume Manager (LVM)?
1) A layer of abstraction that allows easy manipulatin of volumes. Including resizing of filesystems
2) Allows reorganization of filesystems across multiple physical devices
- Device are designated as Physcial Volumes
- One or more Physical Volumes are used to create a Volume Group
- Physical Volumes are defined with Physical Extents of a fixed size
- Logical Volumes are created on Physical Volumes and are composed of Physical Extents
- Filesystems may be created on Logical Volumes
Creating Logical Volumes
1) Create physical volumes
pvcreate /dec/had3
2) Assign physical volumes to volume groups
vgcreate vg0 /dev/hda3
3) Create logical volumes from volume gropus
lvcreate –L 256M –n data vg0
mke2fs –j /dev/vg0/data
Resizing Logical Volumes
1) Growing Volumes
- lvextend can grow logical volumes
- resize2fs can grow ext3 filesystems online
- vgextent adds new physical volumes to an exisiting volume group
2) Shrinking Volumes
- Filesystem must be reduced first
- Required a filesystem check and cannot be performed online
- lvreduce can then reduce the volume
- Volume Groups can be reduced with:
   pvmove /dev/hda3
   vgreduce vg0 /dev/hda3
Logical Volume Manager Snapshots
1) Snapshots are special Logical Volumes that are an exact copy of an existing Logical Volume at the time the snapshot is created
2) Snapshots are perfect for backups and other operations where a temporary copy of an exisiting dataset is needed
3) Snapshots only consume space where they are different from the original Logical Volume
- Snapshots are allocated space at creation but do not use it until changes are made to the original Logical Volumeor the Snapshot
- When data is changed on the original Logical Volume the older data is copied to the Snapshot
- Snapshots contain only data that has changed on the original Logical Volume or the Snapshot since the snapshot was created
Using LVM Snapshots
1) Create Snapshot of existing Logical Volume
# lvcreate –l 64 –s –n databackup /dev/vg0/data
2) Mount Snapshot
# mkdir –p /mnt/databackup
# mount –o ro /dev/vg0/databackup /mnt/databackup
3) Remove Snapshot
# umount /mnt/databackup
# lvremove /dev/vg0/databackup
Archiving tools: tar
1) tar can backup to a file or tape drive
2) supports GZIP and BZIP2 compression
3) can preserve file permissions, ownership and timestamps
4) supports extended attributes
5) uses rmt to write to a remote tape device
Archiving Tools: dump/restore
1) Backup and restore ext2/3 filesystems
- Does not work with other filesystems
- dump should only be used on unmounted filesystems or filesystems that are read-only
2) Can do full or incremental backups
3) Examples:
- dump –0u –f /dev/nst0 /dev/hda2
- restore –rf /dev/nst0
Archiving Tools: rsync
1) Efficiently copies files to or from remote systems
2) Uses secure ssh connections for tranport
rsync *.conf barney:/home/joe/configs/
3) Faster than scp – copies differences in like files
End of Unit 7
1) Questions and Answers
2) Summary
- Filesystem quotas
- Configuration of software RAID
- Software RAID recovery
- Configuration of Logical Volumes
- LVM Snapshots
- Backup Tools
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值