(Linux分区管理.doc
文本预览下载声明
五、分区管理
重点考查在linux系统里面对于硬盘分区,格式化,创建交换分区以及对用户使用的磁盘配额的配置。
在虚拟机上添加1个scsi硬盘,大小为2G;
在新增的硬盘上新建1个1G的分区;
格式化该分区为ext3文件系统;
创建目录/data,将该分区挂载到/data目录。
1.
先把虚拟机关机。
[root@localhost ~]# poweroff
关机后在vmware软件中添加硬盘。
点击编辑虚拟学设置。在弹出的对话框中选择ADD
这是整个创建硬盘的详细过程,在考试过程中,只需要截最后一张图片即可。
2.在新增的硬盘上新建1个1G的分区;
再次打开启动虚拟机。
[root@localhost ~]# fdisk -l
Disk /dev/sda: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1288 83 Linux
/dev/sda3 1289 2563 83 Linux
/dev/sda4 2564 10443 5 Extended
/dev/sda5 2564 3838 83 Linux
/dev/sda6 3839 5113 83 Linux
/dev/sda7 5114 5750 5116671 83 Linux
/dev/sda8 5751 6011 2096451 82 Linux swap / Solaris
Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
[root@localhost ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content wont be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-261, default 261): +1G
Command (m for help): w
[root@localhost ~]# cat /proc/partitions |grep sdb
8 16 2097152 sdb
8 17 987966 sdb1
3.格式化该分区为ext3文件系统;
[root@localhost ~]# mkfs.ext3 /dev/sdb1
4.创建目录/data,将
显示全部