ImageVerifierCode 换一换
格式:DOCX , 页数:13 ,大小:23.36KB ,
资源ID:7273549      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/7273549.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Unit 1 Advanced Filesystem Management.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

Unit 1 Advanced Filesystem Management.docx

1、Unit 1 Advanced Filesystem ManagementUpon completion of this unit, you should be able to:Perform backupsSetup and manage Software RAID devicesConfigure Logical VolumesSetup LVM SnapshotsArchiving Toolstardump/restorersyncProject Amanda3rd party utilitiesArchives are commonly compressedtar natively s

2、upports compression using gzip and gunzip, or bzip2 and bunzip21、 tar命令使用“cf”命令选项可实现对文件和目录的归档=打包tar cvf 文件名.tar 需要备份的文件或目录名2、 打包的同时进行压缩#tar -zcvf filename.tar.gz filename-打包的同时以gzip压缩#tar -jcvf filename.tar.bz2 filename-打包的同时以bzip2压缩3、 查看tar归档文件中的目录列表Tar tf 文件名.tar-查看tar格式的归档文件中的内容参数“t”表示查看归档文件中的文件和

3、目录列表参数“f”指定要查看的归档文件名Tar tzf 文件名.tar.gz-查看压缩的归档文件中的内容参数“z”表示查看的是压缩归档文件Tar jzf 文件名.tar.bz24.、使用tar命令恢复归档文件参数“x”表示释放归档文件Tar -xvf 文件名.tar -C 目录名Tar -zxvf 文件名.tar.gz -C 目录名Tar -jxvf 文件名.tar.bz2 -C 目录名以上两个命令可完成恢复归档文件到指定目录,如果不使用-c选项,tar会将归档文件恢复到当前目录Creating File Archives: Other ToolsZip and unzip Supports

4、pkzip-compatible archives example: #zip -r etc.zip /etc/ #unzip etc.zipfile-roller-Graphical multi-format archiving toolDd命令的用法:语法:dd if= “input_file” of= “output_file” bs=”block_size” count= “number”如将/etc/passwd 备份到/tmp/passwd.back中#dd if=/etc/passwd of=/tmp/passwd.back再如备份/dev/hda的MBR#dd if=/dev/

5、hda of=/tmp/mbr.back bs=512 count=1#dd if=/dev/zero of=/tmp/swap bs=4k count=16382-该档案的大小为4k*16382=63.99M#dd if=/dev/hda of=dev/hdb-完整地将/dev/hda都备份到/dev/hdb中。注解:dd命令是用来转换文件并且用于复制,if指的是要输入文件格式,of指的是输出文件,将其输出到/tmp/swap,bs指的是一个分区占用多少kbytes,count值还有多少bs,文件容量为bs*count64M制作引导光盘:#ls -l /mnt/iso/images/-(/m

6、nt/iso为光盘挂载点,可列出引导盘的镜像文件,boot.iso是安装程序引导光盘的镜像文件,使用光盘刻录软件可以将该文件刻录为引导光盘。Diskboot.img是USB设备引导的镜像文件。使用dd命令可以将该文件制成可安装程序的U盘。方法如下:#dd if=diskboot.img of=/dev/sdaCPIO的用法:原理:通过数据流重导向的方法,将文件进行输入与输出的一种方式。常用于备份与还原#cpio covB file|device-备份#cpio icduv test.cpio-找出test1目录下的所有文件并打包,打包后命名为test.cpio#cpio -it test.cp

7、io-将打包文件test.cpio中的文件显示出来#cpio -id /dev/st0 将磁带机上的数据还原回来 #cpio icduv /dev/st0注解:由于cpio无法直接读取文件,而需要“每一个文件或目录的路径连同文件名一起”才可以记录下来,因此cpio常与find一起使用,虽不太好用,但却可以备份任何数据,包括/dev/中的任何设备文件Remote backupsUsername hostname:/path (username为指定的使用者名称,hostname为远程主机) tar -czvf xiaofanexample:/var/host.tar.gz /home dump

8、-0uf xiaofanexample:/var/home.dump /homeArchiving tools: tartar can backup to a file or tape deviceSupports GZIP and BZIP2 compressionCan preserve file permissions, ownership and timestampsSupports extended attributesUses rmt to write to a remote tape deviceArchiving Tools: dump/restoreBack up and r

9、estore ext2/3 filesystems Does not work with other filesystems dump should only be used on unmounted filesystems or filesystems that are read-only.Can do full or incremental backupsExamples: Dump -0u -f /dev/nst0 /dev/hda2 (其中“-0-9”: “-0”指的是完全备份; “-1 -9”指的是增量备份) Restore -rf /dev/nst0Using dump The d

10、ump command can be directed to read /etc/fstab and do backups based on information it keeps as to which filesystems need to be backed up.For example,Dump -0u -f /dev/nst1 /homeWill do a full backup of the /home filesystem onto the tape device nst1. The u option will update the file /etc/dump dates,

11、which will record dump information for future use by dump. After a level 0 backup, dump will perform an incremental backup every day on active filesystems listed in /etc/fstab.The command:Dump -4u -f /dev/nst1 /homeWill perform an incremental update of all files that changed since the last backup of

12、 level 3 or lower, as recorded in the /etc/dumpdates file.Dump -0uf xiaofansvr:/dev/nst0 /homePerforms a remote backup using rmt. Use userhost:path format to specify the remote user, host, and device. SSH can be used as a transport layer when $RSH is set to ssh.Using restoreTo restore data backed up

13、 with dump, make a clean filesystem(using mkfs), mount the filesystem, and cd to the directory where the filesystem is mounted. Then run the restore command:Restore -rf /dev/nst1Archiving Tools: rsyncEfficiently copies files to or from remote systemsUses secure ssh connections for transport rsync *.

14、conf barney:/home/joe/configs/Faster than scp copies differences in like filesRsync is a program that works in much the same way that the older rcp does, but has many more options and uses the rsync remote-update protocol to greatly increase the speed of file transfers when the destination file alre

15、ady exists.The rsync remote-update protocol allows rsync to transfer just the differences between two sets of files using an efficient checksum-search algorithm. This utility is useful for tasks like updating web content, because it will only transfer the changed files.Useful options to rsync-e comm

16、and-specifies an external, rsh-compatible program to connect with (usually ssh)-a -recurs subdirectories, preserving permissions, etc.-r -recurs subdirectories without preserving permissions, etc.-partial-continues partially downloaded files-progress-prints a progress bar while transferring-P -is th

17、e same as -partial -progress -p -preserve permissions-A -preserve ACLs (implies p)-X -preserve extended attributes (implies p)What is Software RAID?Multiple disks grouped together into “arrays” to provide better performance, redundancy or both.mdadm -provides the administration interface to software

18、 RAID.Many “RAID Levels” supported, including RAID 0, 1, 5 and 6.Spare disks add extra redundancyRAID devices are named, /dev/md0, /dev/md1, /dev/md2, /dev/md3 and so on.The most command only used RAID are:RAID 0 or Striping(带区卷): Two or more disks used to create a single large high performance volu

19、me. Performance is better if drivers of equal size are used. No redundancy, so chance of failure is very high. Array size equals the sum of all disks in array.RAID 1 or Mirroring: Two disks containing the same data updated simultaneously. Redundancy offers good protection against disk failure. Can s

20、low write performance but tends to improve read performance. Only RAID type that you can place the /boot partition on. Hot spare disks can be used to improve fault-tolerance. Array size equals the size of the smallest disk used.RAID 5: Three or more disk with zero or more hot spares. A good balance

21、between performance and reliability. Redundancy is achieved by splitting(分区) parity(奇偶性) between all disks, one disk can be lost without causing array failure. Both read and write speeds are usually improved, but in certain cases write performance is dramatically decreased. For this reason RAID 5 is

22、 often not a good choice to host databases.RAID 6, or striping with dual (duplicated) distributed parity. Similar to RAID5 except that it improves fault tolerance by allowing the failure of any two drives in the array. While the simultaneous failure of two devices may be an unlikely event, RAID6 pro

23、tects the array from data loss during recovery of a single disk failure, provides the administrator additional time to perform rebuilds, improves the viability of less expensive drives in enterprise storage solutions, and, since RAID only passively checks for bad blocks, protection from undiscovered

24、 block errors.Once an array is created its device, /dev/md0 for example, is used the same way as /dev/hda6 or /dev/sda6 may have been used in an earlier example.Software RAID ConfigurationCreate and define RAID devices using mdadm Mdadm -C /de/md0 -a yes -l 1 -n 2 -x 1 elementsFormat each RAID devic

25、e with a filesystem Mke2fs -j /dev/md0Test the RAID devices mdadm allow you to check the status of your RAID devicesMdadm -detail /dev/md0 provides notification services on the statusSoftware RAID Testing and RecoverySimulating(模拟) disk failures Mdadm /dev/md0 -f /dev/sda1Recovering from a software

26、RAID disk failure Replace the failed hard drive and power on Reconstruct partitions on the replacement drive mdadm /dev/md0 -a /dev/sda1 mdadm -r -remove the failed disk from the arraymdadm, /proc/mdstat, and syslog messagesDisassemble(反汇编) or auto-assemble disk array Mdadm -S /dev/md0 Mdadm -A -sWh

27、at is Logical Volume Manager (LVM)?A layer of abstraction that allows easy manipulation of volumes. Including resizing of filesystemsAllow reorganization of filesystems across multiple physical devices Devices are designated as Physical Volumes One or more Physical Volumes are used to create a Volum

28、e Group Volume Groups are defined with Physical Extents of a fixed size Logical Volumes are created on Volume Groups and are composed of Physical Extents Filesystems may be created on Logical VolumesCreating Logical VolumesCreate physical volumes Pvcreate /dev/hda3Assign physical volumes to volume g

29、roups Vgcreate vg0 /dev/hda3Create logical volumes from volume groups Lvcreate -L 256M -n data vg0 Mke2fs -j /dev/vg0/dataResizing Logical VolumesGrowing Volumes lvextend can grow logical volumes resize2fs can grow ext3 filesystem online offlineShrinking volumes Must be done offline (umount) Require

30、s a filesystem check (e2fsck) first Filesystem then reduced (resize2fs) Lastly, lvreduce can then reduce the volumeVolume Groups can be enlarged with vgextendVolume Groups can be reduced with: Pvmove /dev/hda3 Vgreduce vg0 /dev/hda3Logical Volume Manager SnapshotsSnapshots are special Logical Volumes that are an exact copy of an existing Logical Volume at the time the snapshot is createdSnapshots are perfect for backups and other operations where a temporary copy of an existing dataset is neededSnapshots only consume space where they are different from the original Logical Volume Snapshots

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1