1.在安装好的linux系统中新加一块硬盘,将硬盘分成2个主分区,和2个逻辑分区,将其中一个逻辑分区设置成vfat(FAT32)分区,并实现开机自动挂载所有分区。

答:添加一个硬盘为sdb

[ rootetocathost - I # /dev/sd* 
1 root disk 8, 
. I root disk 8, 
brw-rw----. 
1 root disk 8, 
I root disk 8, 
brw_rw____. 
[ rnorBI ncal hnqt •I 
16 9k 
3 19:10 
3 19:10 
3 19:10 
uevg'suc- 
dev/sda-_ 
dev/sda& 
aeufsct

分成2个主分区,2个逻辑分区

Boot 
/ dev/ sdbl 
/ dev/sdb2 
dev/ sdb3 
'dev/sdb5 
/ dev/ sdb6 
Start 
2048 
2099200 
4196352 
4198400 
6297600 
End 
2099199 
4196351 
41943039 
6295551 
41943039 
Blocks 
Id System 
1048576 
1048576 
18873344 
1048576 
17822720 
83 
83 
5 
83 
83 
Linux 
Linux 
Extended 
Linux 
Linux

格式化磁盘

[ root810caIhost # 
mkts. xfs 
meta- data=/dev/sdbl 
data 
naming 
A'ersion 2 
—internal log 
real time 410ne 
I root'localhost # mkts. 
meta- data=/dev/sdb2 
xfs 
data 
n aming 
og 
z*ersion 2 
—internal log 
(dev/ Sdbl 
isize=512 
sectsz=512 
c rc4 
bsize4)96 
suni 
bsize4396 
bsize—1096 
sectsz=512 
ext sz4096 
(dev/ sdb2 
isize412 
sectszél 2 
bsize4396 
Suni 
bsize4396 
bsize-1096 
sectszz512 
extsz=4096 
/dev/sdb 
s db6 
agcounæ, agsize=$SS36 blks 
attr=a, projid32bit4 
finobt=O, sparse:O 
blocks -262144, imaxpctQ5 
blks 
ascii- ci=O f typeA 
version=Q 
Sunit=O blks, lazy- countA 
blocks=O, rtextents41 
agcounW, agsize=65536 blks 
attrQ, 
f inobt20, sparsæ) 
blocksQ62144, imaxpcté 
swidth4) blks 
ascii- ci=O ftype=å 
blocks-2560, 
sunitzO blks, lazy- count—I 
blocks-0, rtextents=o 
real time 
[ root8tocathost # mkfs.xfs 
sdbl sdb2 sdb3 sdb5

将其中一个逻辑分区设置成fat32分区

[ root810caIhost # mkfs. vtat /dev/sdb5 
nıkfs. fat (12 Jun 2013) 
[ rootQlocaIhost


/ dev/sdbS 
rootOIocaIhost 
vfat 
1.1 G 
4.1k 
1.16


并实现开机自动挂载

先查看磁盘类型

I root610caIhost -1 # blkid / dev/sdb6 
/devtsdb6: UUID='8813b71a-6bb9-4S7e-Bf80-4491ee2744fe" TYPE=• xfs" 
I root610calhost -l # blkid /dev/sdb5 
/dev/sdb5: UUID='6c56- DF17' vfat" 
I root610calhost -l mkts. xfs /dev/sdb2 
mkfs. xfs: / dev/sdb2 appears to contain an existing filesystem (xfs) 
mkts. xts: Use the -t option to force overwrite. 
rootOIocaIhost -1 # mkfs. xfs / dev/sdbl 
mkts. xfs: /dev/sdbl appears to contain an existing fitesystem (xfs) . 
mkfs. xfs: Use the -f option to force overwrite. 
1 
rootblocalhost

进入vim编辑 

9±21 ed. beta. 
/ dev/mapper/centos. Swap 
81 da- 803848 feebtl 
S wap 
'boot 
vtat 
defaul 
/ dev/sdbl 
/ dev/ sdb2 
/ dev/sdbS 
/ dev/sdb6 
lbs 
defaults 
defaults 
defaults 
defaults 
1



2.设置远程管理,并使远程管理时能够正常输入和显示中文

答:配置IP地址,修改网卡   使用finashell连接linux

虚拟机配置地址

i fl root•tocalhost 
# ifconfig 
ens33: 63 dip, BROADCAST, RUNNING, MULTICAST> mtu 
inet 192.168.1.100 netmask 2SS.255. 235.0 broadcast 192.168.1 .255

Finalshell连接linux

磁盘和文件系统管理实验_linux虚拟机