实验八 系统和磁盘管理.doc_第1页
实验八 系统和磁盘管理.doc_第2页
实验八 系统和磁盘管理.doc_第3页
实验八 系统和磁盘管理.doc_第4页
实验八 系统和磁盘管理.doc_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

实验八 文件系统和磁盘管理实验八 文件系统和磁盘管理(一)磁盘分区管理【需求】u 为一个有空闲空间的磁盘新建一个分区;u 对该分区进行格式化;u 把该分区挂载到/mnt/music目录;u 要求每次机器启动都自动挂载。【系统及软件环境】操作系统:Red Hat AS 4.0【实验配置文件及命令】1配置文件:/etc/fstab2命令:/sbin/fdisk,/sbin/mkfs.ext3,/bin/mkdir,/bin/mount【实验步骤】1 系统当前的分区表信息。rootlinux /# fdisk -lDisk /dev/hda: 80.0 GB, 80060424192 bytes255 heads, 63 sectors/track, 9733 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/hda1 * 1 13 104391 83 Linux/dev/hda2 14 1288 10241437+ 83 Linux/dev/hda3 1289 1415 1020127+ 82 Linux swap/dev/hda4 1416 9733 66814335 5 Extended/dev/hda5 1416 1496 650601 8e Linux LVM/dev/hda6 1497 1517 168651 fd Linux raid autodetect/dev/hda7 1518 1538 168651 fd Linux raid autodetect/dev/hda8 1539 1557 152586 83 Linux/dev/hda9 1558 2321 6136798+ 83 Linux/dev/hda10 2322 2386 522081 82 Linux swap由上面的信息可知,系统的扩展分区/dev/hda4中还有空闲的空间(因为该磁盘共有9733个柱面,/dev/hda4的结束柱面为9733,而该扩展分区中的最后一个逻辑分区/dev/hda10的结束柱面为2386,所以柱面23879733都是空闲的),于是可以新建一个100M的分区。2用fdisk新建一个分区。rootlinux /# fdisk /dev/hdaThe number of cylinders for this disk is set to 9733.There is nothing wrong with that, but this is larger than 1024,and could in certain setups cause problems with:1) software that runs at boot time (e.g., old versions of LILO)2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)Command (m for help): nFirst cylinder (2387-9733, default 2387): 2387Using default value 2387Last cylinder or +size or +sizeM or +sizeK (2387-9733, default 9733): +100MCommand (m for help): wThe 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.rootlinux /# reboot最后的警告,要求系统重启,新的分区表才会生效。3再查看系统的分区表,可以看到多了1个分区/dev/hda11。rootlinux /# fdisk -lDisk /dev/hda: 80.0 GB, 80060424192 bytes255 heads, 63 sectors/track, 9733 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/hda1 * 1 13 104391 83 Linux/dev/hda2 14 1288 10241437+ 83 Linux/dev/hda3 1289 1415 1020127+ 82 Linux swap/dev/hda4 1416 9733 66814335 5 Extended/dev/hda5 1416 1496 650601 8e Linux LVM/dev/hda6 1497 1517 168651 fd Linux raid autodetect/dev/hda7 1518 1538 168651 fd Linux raid autodetect/dev/hda8 1539 1557 152586 83 Linux/dev/hda9 1558 2321 6136798+ 83 Linux/dev/hda10 2322 2386 522081 82 Linux swap/dev/hda11 2387 2399 104391 83 Linux4格式化该分区。rootlinux /# mkfs.ext3 /dev/hda115把该分区挂载到/mnt/music目录。rootlinux /# mkdir /mnt/musicrootlinux /# mount /dev/hda11 /mnt/music6在/etc/fstab最后添加一项,使其每次开机都自动挂载。rootlinux /# vi /etc/fstab# This file is edited by fstab-sync - see man fstab-sync for detailsLABEL=/ / ext3 defaults 1 1LABEL=/boot /boot ext3 defaults 1 2none /dev/pts devpts gid=5,mode=620 0 0none /dev/shm tmpfs defaults 0 0none /proc proc defaults 0 0none /sys sysfs defaults 0 0/dev/hda3 swap swap defaults 0 0LABEL=SWAP-hda10 swap swap defaults 0 0/dev/hda11 /mnt/music ext3 defaults 0 0【实验故障与分析】下面的表格中列出了在实验过程中可能会出现的故障及其解决方法。看看是不是对你的实验有所帮助?如果你在实验中还遇到了其他的问题或故障,不妨记录在表格中,通过自己的实践,或者与老师、同学一起找找解决问题的方法。序 号实验故障分析与解决1无法创建hda11逻辑分区的编号是从5开始,自动递加23【启发联想】1系统中哪些分区的大小不能修改,哪些分区的大小可以修改?2如果硬盘没有空闲空间,而又需要多建一个分区,怎么处理?(二)U盘管理【需求】u 挂载一个文件系统为FAT32类型的U盘。【系统及软件环境】操作系统:Red Hat AS 4.0【实验配置文件及命令】1配置文件:无2命令:/sbin/fdisk,/bin/mkdir,/bin/mount,/bin/umount【实验步骤】1插入U盘后,就可查看该U盘的设备名及分区表信息。rootlinux /# fdisk -lDisk /dev/hda: 80.0 GB, 80060424192 bytes255 heads, 63 sectors/track, 9733 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System/dev/hda1 * 1 13 104391 83 Linux/dev/hda2 14 1288 10241437+ 83 Linux/dev/hda3 1289 1415 1020127+ 82 Linux swap/dev/hda4 1416 9733 66814335 5 Extended/dev/hda5 1416 1496 650601 8e Linux LVM/dev/hda6 1497 1517 168651 fd Linux raid autodetect/dev/hda7 1518 1538 168651 fd Linux raid autodetect/dev/hda8 1539 1557 152586 83 Linux/dev/hda9 1558 2321 6136798+ 83 Linux/dev/hda10 2322 2386 522081 82 Linux swap/dev/hda11 2387 2399 104391 83 LinuxDisk /dev/sda: 264 MB, 264110080 bytes16 heads, 32 sectors/track, 1007 cylindersUnits = cylinders of 512 * 512 = 262144 bytesDevice Boot Start End Blocks Id System/dev/sda1 * 1 1008 257904 b W95 FAT32Partition 1 has different physical/logical endings:phys=(1023, 15, 32) logical=(1007, 7, 32)上面的/dev/sda即是刚插入的U盘,它只有一个分区/dev/sda1,类型为FAT32。在Red Hat AS 4.0中,只要插入U盘,系统就会把它自动挂载到/media目录下,但是存在一个问题就是,如果U盘里的文件名为中文的话,就不能正常显示;如果想让它能够正常显示中文文件名,就需要手动挂载。2先卸载,然后手动挂载。rootlinux /# umount /dev/sda1rootlinux /# mkdir /media/u-diskrootlinux /# mount -o iocharset=gb2312 /dev/sda1 /media/u-diskrootlinux /# ls /media/u-disk/硕士学位论文0525.doc 答辩建议.txtexe20040607.doc 计算机系2004级毕业答辩通知版.xls 挂载时,设置了iocharset选项后即可正常显示中文文件名。【实验故障与分析】下面的表格中列出了在实验过程中可能会出现的故障及其解决方法。看看是不是对你的实验有所帮助?如果你在实验中还遇到了其他的问题或故障,不妨记录在表格中,通过自己的实践,或者与老师、同学一起找找解决问题的方法。序号实验故障分析与解决1无法挂载sdal这可能是因为系统中已经有一个或多个SCSI设备,这个情况下U盘的名称不再是sda23【启发联想】1U盘的名称是如何约定的?2如果系统中插入了多个U盘,如何处理?(三)autofs服务【需求】u 利用autofs自动挂载一个nfs文件系统;u 假设局域网中有一台nfs服务器,其IP为,共享目录为/tmp;本机 的IP为,要求把nfs服务器的/tmp目录挂载到本机的/mnt/nfs目录上。【系统及软件环境】1操作系统:Red Hat AS 4.02软件:autofs-4.1.3-169【实验配置文件及命令】1配置文件: /etc/auto.master,/etc/auto.misc2命令:/usr/bin/vim,/sbin/service【实验步骤】1编辑/etc/auto.master,在末尾添加一行。rootlinux tmp# vi /etc/auto.master# $Id: auto.master,v 1.3 2003/09/29 08:22:35 raven Exp $# Sample auto.master file# This is an automounter map and it has the following format# key -mount-options-separated-by-comma location# For details of the format look at autofs(5).#/misc /etc/auto.misc -timeout=60#/misc /etc/auto.misc#/net /etc/ /mnt /etc/auto.misc -timeout=302编辑/etc/auto.misc,在末尾添加一行。rootlinux tmp# vi /etc/auto.misc# $Id: auto.misc,v 1.2 2003/09/29 08:22:35 raven Exp $# This is an automounter map and it has the following format# key -mount-options-separated-by-comma location# Details may be found in the autofs(5) manpagecd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom# the following entries are samples to pique your imagination#linux -ro,soft,intr :/pub/linux#boot -fstype=ext2 :/dev/hda1#floppy -fstype=auto :/dev/fd0#floppy -fstype=ext2 :/dev/fd0#e2floppy -fstype=ext2 :/dev/fd0#jaz -fstype=ext2 :/dev/sdc1#removable -fstype=ext2 :/dev/hddnfs -ro,soft,int

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论