Manage hard disk partition, format, and a file system

Correspondence between hardware devices and file name of the
disk structure and hard disk partition
why the hard disk partition
the hard drive logical structure of
Linux system hard disk partition
classification of hard disk partition of
the partition number of constraints
using fdisk and partprobe commands to manage hard disk partition
function fdisk command
fdisk command list commonly used commands
partprobe command
to create a file system (management data)
What is formatting
What is a file system
file system type
function mkfs command
usage examples mkfs command
to set a partition label (partition name)
e2label command functions
e2label command usage examples
homework

[This section]
1 correspondence between hardware devices and file name (see linux system administration P297)
1) rests in the Linux system, each device is to treat the original file.
2) master a variety of device file names in Linux

2. Hard disk structure and hard disk partition (see linux system administration P301)
1) To understand why the hard disk partition:
A) easier to manage and control the system, because the associated files and directories are placed in a partition.
b) greater system efficiency.
c) to limit users to share hard disk (amount of disk space).
d) easier to backup and recovery.
2) grasp the logical structure of a hard disk:
a hard disk can be logically divided into blocks, tracks, and cylinders partition.
Definition 3) control block: the block is the smallest unit of addressing on the disk (access) of a certain block of bytes of data may be stored.
4) define the master track: circle blocks consisting of tracks are connected by a series of head and tail.
5) definition of master cylinders: a stack of a track is cylinders, the tracks on each disk surface is composed of the same radius.
6) definition of master partition: the partition is a group composed of adjacent cylinders.
3. Linux system hard disk partition (see linux system administration P303)
1) hard disk partition master classification: hard disk partitions can be divided into a primary partition, extended partitions and logical partitions.
2) the number of master primary partition: on a hard disk can be divided into up to four primary partitions.
3) to understand the number of partitions on each hard disk Linux operating system kernel support or have certain restrictions, Linux kernel can support up on each hard disk:
A) divided 15 partitions (Partitions) on a SCSI hard disk.
b) dividing partitions 63 (Partitions) IDE hard disk.
4. Use fdisk and partprobe commands to manage hard disk partitions (see linux system administration P394)
1) control function fdisk command: Create Partition.
2) fdisk command master list of commonly used commands:
A) d: Delete a (already existing) partition, where d is the first delete one letter.
b) l: List () existing partition type, where l is the first letter of the list.
c) m: All the commands used fdisk, where m is the first letter of the menu.
d) n: to add a new partition, where n is the new first letter.
e) p: lists the contents of the partition table, wherein p is the first letter of the print.
f) q: Exit the fdisk, but the change did not stored, wherein q is the first letter of the quit.
g) t: changing the system partition id, where t is the title of the first letter.
h) w: exit fdisk changes that were made and stored, where w is the first write a letter.
3) master partprobe command functions: to re-initialize memory in the kernel partition table.
5. Create a file system (management data) (see linux system management P399)
. 1) defined formatting control: so-called formatting is to partition the hard disk space is divided into a number of data blocks (Blocks) of equal size, and this partition set the number of i-nodes can be used and so on.
2) define the master file system: file system is the operating system used in the methods and data structures of the file on the disk or partition clear; namely organizational methods files on the disk.
3) Identifying common file system type
ext2: Linux systems the standard file system
ext3: a journaling file system
ext4: one for system expansion ext3 journaling file system
lvm: logical disk volume management 
iso9660: the only common Compact Disc file system 
4) master the mkfs command functions: to format the disk.
5) flexible application of common formatting commands:
. The mkfs file system type
, for example, partition / dev / sdb1 ext4 file system format for the command is:
mkfs.ext4 / dev / sdb1
6. The partition is set to a label (partition name) (see linux system administration P405)
1) control function e2label command: set or check the label the name of a device.
2) Flexible setting command e2label label application:
A) such as: View / label command dev / sdb1 partition is:
e2label / dev / sdb1
B), for example: a / dev / sdb1 partition wg label set of commands:
the e2label / dev / sdb1 WG
7. the homework (using 40 minutes)
1) On Linux system before adding the size of a hard disk SCSI 20G
2) open the system, click on the desktop, open the terminal
3) adding a new hard disk partition, 1OG is a primary partition size, the remaining space to the extended partition, dividing two logical partitions, size of each partition in the expansion 5G
4) to format the primary partition ext3 system
5) for the two logical partitions formatted system ext4
6) based Add partition label wg
7) Check the primary partition label


文件系统的挂载与卸载
什么是挂载
mount命令的功能
mount命令的用法举例
umount命令的功能
umount命令的用法举例
利用/etc/fstab文件在开机时自动挂载文件系统
虚拟内存的概念以及设置与管理
什么是虚拟内存
创建swap分区的步骤
使用硬盘分区创建和使用系统交换分区的实例
mkswap 命令的功能
mkswap 命令的用法举例
swapon命令的功能
swapon -a 
swapon -s
swapon命令的用法举例
i节点
什么是i节点
符号(软)链接
什么是符号链接
使用ln命令创建软连接
硬链接
什么是硬链接
使用ln命令创建硬链接
Linux系统中的文件类型
Linux系统中的常见文件类型
怎样检查磁盘空间
df命令
du命令
课后作业
【本节内容】
1. 文件系统的挂载与卸载(详见linux系统管理P406)
1) 掌握挂载的定义:挂载指将一个设备(通常是存储设备)挂接到一个已存在的目录上。
2) 掌握mount命令的功能:实现文件系统的挂载。
3) 灵活应用mount命令实现文件系统的挂载:
例如:将/dev/sdb1分区挂载到/wg目录上的命令:
mount /dev/sdb1 /wg
4) 掌握umount命令的功能:实现文件系统的卸载。
5) 灵活应用umount命令实现文件系统的卸载:
例如:卸载/wg上的文件系统的命令:
umount /wg
2. 虚拟内存的概念以及设置与管理(详见linux系统管理P414)
1) 掌握虚拟内存的定义:所谓虚拟内存就是一块硬盘空间被当做内存使用,也被称为交换分区(swap)。
2) 了解Linux交换分区的类型为:0x82
3) 掌握mkswap命令的功能:设置交换分区。
4) 掌握使用mkswap命令设置交换分区的用法举例:
例如:将分区/dev/sdb2设置为交换分区的命令:mkswap /dev/sdb2
5) 掌握swapon命令的功能:启动交换分区。
6) 掌握swapon –a命令的功能:启动全部的交换分区。
7) 掌握swapon –s命令的功能:列出当前正在使用的所有系统交换分区的状态。
8) 掌握使用swapon命令的用法举例:
例如:启用交换分区/dev/sdb2的命令:swapon /dev/sdb2
3. i节点(详见linux系统管理P170)
1) 掌握i节点的定义:i节点实际上是一个数据结构,它存放了有关一个普通文件、目录或其他文件系统对象的基本信息。
4. 符号(软)链接(详见linux系统管理P174)
1) 掌握符号链接的定义:符号链接是指向另一个文件的一个文件。
2) 掌握ln命令创建软连接的用法举例:
a) 为wolf/dog.wolf.baby文件建立一个dog_ wolf.boy符号链接并放在bodydog目录中的命令:
ln –s wolf/dog.wolf.baby bodydog/dog_ wolf.boy
5. 硬链接(详见linux系统管理P179)
1) 掌握硬链接的定义:一个硬链接(hard link)是一个文件名与一个i节点之间的对应关系,也可以认为一个硬链接是在所对应的文件上添加了一个额外的路径名。
2) 掌握ln命令创建硬连接的用法举例:
a) 为wolf/wolf.dog文件在backup目录中建立一个名为wolf.dog2的硬链接命令:
ln wolf/wolf.dog backup/wolf.dog2
6. Linux系统中的文件类型(详见linux系统管理P183)
1) 掌握Linux系统中常见的文件类型:
-:普通文件(regular file),也有人称为正规文件。
d:目录(directory)。
l:符号(软)链接。
b:块特殊文件(b是block的第1个字符),一般指块设备,如硬盘。
c:字符特殊文件(c是character的第1个字符),一般指字符设备,如键盘。
7. 怎样检查磁盘空间(详见linux系统管理P185)
1) 掌握df命令的功能:显示文件系统中磁盘使用和空闲区的数量。
-a 显示所有磁盘
-h 单位转换
2) 掌握du命令的功能: 显示目录和文件的大小a h同上

8. 课后作业(用时65分钟)
1) 开启Linux系统前添加一块大小为15G的SCSI硬盘
2) 开启系统,右击桌面,打开终端
3) 为新加的硬盘分区,一个主分区大小为5G,剩余空间给扩展分区,在扩展分区上划分1个逻辑分区,大小为5G
4) 格式化主分区为ext3系统
5) 将逻辑分区设置为交换分区
6) 启用上一步的交换分区
7) 查看交换分区的状态
8) 新建目录/dir1
9) 将主分区挂载到/dir1目录
10) 查看整个磁盘的使用情况
11) 查看/分区的使用总量
12) 在root用户的家目录新建文件file1
13) 为file1创建硬链接file2
14) 为file1创建符号链接file3
15) 以长列表格式显示root用户家目录下的内容,要求显示i阶段,并比较硬链接、符号链接的i节点和原文件的关系

Guess you like

Origin www.cnblogs.com/Centwei/p/11302818.html