RH133 Unit 6 Filesystem Management

来源:互联网 发布:property python 编辑:程序博客网 时间:2024/06/09 22:43
Objectives
Upon completion of this unit, you should be able to:
- Understand filesystem hierarchy
- Manage virtual memory
- Add new drives and partitions
- Mount NFS filesystems
Overview: Adding New Filesystems to the Filesystem Tree
- Identify Device
- Partition Device
- Make Filesystem
- Label Filesystem
- Create entry in /etc/fstab
- Mount new filesystem
Device Recognition
1) Master Boot Record (MBR) contains:
- Execute code to load operating system
- Space to partion table information, including:
- Partion id or type
- Starting cylinder for partition
- Number of cylinders for partition
Disk Partitioning
1) An extended partition points to additional partition descriptors
2) Total maxium number of partitions supported by the kernel:
- 63 for IDE drives
- 15 for SCSI drives
3) Why partition drives?
- containment, performance, quotas, recovery
Managing Partitions
1) Creating partitions using:
- fdisk
- sfdisk
- GNU parted – advanced partition manipulatioin (create, copy, resize, etc.)
2) partprobe – reinitializes the kernel’s in-memory version of the partition table
Making Filesystems
1) mkfs
2) mkfs.ext2, mkfs.ext3, mkfs.msdos
3) Specific filesystem utilities can be called directly
- mke2fs [option] device
Filesystem Labels
1) Alternate way to refer to devices
2) Device independent
- e2label special_dev-file [fslabel]
- mount [option] LABEL=fslabel mount_point
3) blkid can be used to see labels and filesystem type of all devices.
tune2fs
1) Adjusts filesystem parameters
- reserved blocks
- default mount options
- fsck frequency
2) View current settings with dumpe2fs
Mount Points and /etc/fstab
1) Configuration of the filesystem hierarchy
2) Used by mount, fsck, and other programs
3) Maintains the hierachy between system reboots
4) May use filesystem volume labels in the device field
5) The mount –a command can be used to mount all filesystems listed in the /etc/fstab
Mouting Filesystems with mount
1) mount [options] device mount_point
- -t vfstype (normally not needed)
- -o options
- Default options: rw, suid, dev, exec, acl and async
Unmounting Filesystems
1) umount [options] device | mount_point
2) You can not unmount a filesystem that is in use
- Use fuser to check and/or kill processes
3) Use the remount option to change a mounted filesystem’s option automatically
- mount –o remount,ro /data
mount By Example
1) Sample filesystem requirements met using options:
- Disabling execute access
- Mounting a filesystem image
- Mounting a PC-compatible filesystem
- Disabling access time updates
- Setting up a mount alias
Handling Swap Files and Partitions
1) Swap space is a supplement to system RAM
2) Basic setup involves:
- Create swap partition or file
- Write special signature using mkswap
- Add appropriate entries to /etc/fstab
- Activate swap space with swapon –a
Mounting NFS Filesystems
1) Makes a remote NFS filesystem work as though it were a local filesystem
2) /etc/fstab can be used to specify persistent network mounts
3) NFS shares are mounted at boot time by etc/init.d/netfs
4) Exports can be mounted manually with the mount command.
- mkdir /mnt/server1
- mount –t nfs server1:/var/ftp/pub /mnt/server1
Automounter
1) System administrator specifies mount points controlled by automounter daemon process in /etc/auto.master
2) The automounter monitors access to these directories and mounts the filesystem on demand
3) Filesystems automatically unmounted after a specified interval of inactivity
4) Enable the special map –host to “browser” all NFS exports on the network
5) Supports wildcard directory names
Direct Maps
1) Direct maps include absolute path names
2) Does not obscure local directory structure
3) Example:
/etc/auto.master:
/- /etc/auto.direct
 
/etc/auto.direct:
/foo server1:/export/foo
/usr/local server1:/usr/local
gnome-mount
1) automatically mounts removable devices
2) integrated withthe HAL (Hardware Abstraction Layer)
3) replace fstab-sync
End of Unit 6
1) Questions and Answers
2) Summary
- What tools are available for partitioning?
- What two ways can swap space be implemented?
- Mount NFS
原创粉丝点击