自定義網(wǎng)站模塊seo優(yōu)化教學(xué)視頻
目錄
實(shí)驗(yàn)要求
實(shí)驗(yàn)操作
1、?為L(zhǎng)inux新添加一塊SCSI磁盤(pán)/dev/sdc,容量為1024MB。在該磁盤(pán)上創(chuàng)建三個(gè)分區(qū)sdc1、sdc2、sdc3,大小為128MB,標(biāo)識(shí)為L(zhǎng)inux native分區(qū)。
2、?在三個(gè)分區(qū)上創(chuàng)建物理卷;將三個(gè)物理卷加入VolGroup00卷組;在VolGroup00卷組上創(chuàng)建LogVolHome邏輯卷,大小為300M。
3、在LogVolHome邏輯卷上創(chuàng)建ext4文件系統(tǒng),并掛載到/mnt/mntpoint下。
4、對(duì)邏輯卷LogVolHome上的文件系統(tǒng)擴(kuò)容
實(shí)驗(yàn)要求
- 為L(zhǎng)inux新添加一塊SCSI磁盤(pán)/dev/sdc,容量為1024MB。在該磁盤(pán)上創(chuàng)建三個(gè)分區(qū)sdc1、sdc2、sdc3,大小為128MB,標(biāo)識(shí)為L(zhǎng)inux native分區(qū)。
- 在三個(gè)分區(qū)上創(chuàng)建物理卷;將三個(gè)物理卷加入VolGroup00卷組;在VolGroup00卷組上創(chuàng)建LogVolHome邏輯卷,大小為300M。
- 在LogVolHome邏輯卷上創(chuàng)建ext4文件系統(tǒng),并掛載到/mnt/mntpoint下。
- 對(duì)邏輯卷LogVolHome上的文件系統(tǒng)擴(kuò)容
- 為L(zhǎng)inux新添加一塊SCSI磁盤(pán)/dev/sdd,容量為256MB。在該磁盤(pán)上創(chuàng)建一個(gè)分區(qū)sdd1,大小為256MB,分區(qū)類(lèi)型為8e。
- 在分區(qū)sdd1上創(chuàng)建物理卷。將新創(chuàng)建的物理卷擴(kuò)展到VolGroup00卷組。
- 對(duì)VolGroup00卷組中的LogVolHome邏輯卷進(jìn)行擴(kuò)容。
- 對(duì)LogVolHome邏輯卷上的文件系統(tǒng)進(jìn)行擴(kuò)容。
實(shí)驗(yàn)操作
1、?為L(zhǎng)inux新添加一塊SCSI磁盤(pán)/dev/sdc,容量為1024MB。在該磁盤(pán)上創(chuàng)建三個(gè)分區(qū)sdc1、sdc2、sdc3,大小為128MB,標(biāo)識(shí)為L(zhǎng)inux native分區(qū)。
### 添加硬盤(pán)后記得重啟
fdisk -l |grep /dev/sdc # 查看是否添加成功
fdisk /dev/sdc # 進(jìn)入fdisk交互界面# 建立新分區(qū)流程:循環(huán)三次
Command (m for help): n
Partition type:p primary (0 primary, 0 extended, 4 free)e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-2097151, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151): +128M# 更改分區(qū)類(lèi)型:循環(huán)三次
Command (m for help): t
Partition number (1-3, default 3): 1
Hex code (type L to list all codes): 83
Changed type of partition 'Linux' to 'Linux'# 編輯好后w保存退出
Command (m for help): w
2、?在三個(gè)分區(qū)上創(chuàng)建物理卷;將三個(gè)物理卷加入VolGroup00卷組;在VolGroup00卷組上創(chuàng)建LogVolHome邏輯卷,大小為300M。
這里先給出邏輯卷的基本管理:創(chuàng)建、查看、調(diào)整操作命令
# 創(chuàng)建物理卷
pvcreate /dev/sdc1 /dev/sdc2 /dev/sdc3
# Physical volume "/dev/sdc1" successfully created.
# Physical volume "/dev/sdc2" successfully created.
# Physical volume "/dev/sdc3" successfully created.
# 查看物理卷
pvdisplay #創(chuàng)建卷組
vgcreate VolGroup00 /dev/sdc1 /dev/sdc2 /dev/sdc3
# Volume group "VolGroup00" successfully created
# 查看卷組
vgdisplay# 創(chuàng)建邏輯卷
lvcreate -L 300M -n LogVolHome VolGroup00
# Logical volume "LogVolHome" created.
# 查看邏輯卷
pvdisplay --- Logical volume ---LV Path /dev/VolGroup00/LogVolHome
3、在LogVolHome邏輯卷上創(chuàng)建ext4文件系統(tǒng),并掛載到/mnt/mntpoint下。
mkdir -p /mnt/mntpoint
mkfs -t ext4 /dev/VolGroup00/LogVolHome
mount /dev/VolGroup00/LogVolHome /mnt/mntpoint/
4、對(duì)邏輯卷LogVolHome上的文件系統(tǒng)擴(kuò)容
- 為L(zhǎng)inux新添加一塊SCSI磁盤(pán)/dev/sdd,容量為256MB。在該磁盤(pán)上創(chuàng)建一個(gè)分區(qū)sdd1,大小為256MB,分區(qū)類(lèi)型為8e。
- 在分區(qū)sdd1上創(chuàng)建物理卷。將新創(chuàng)建的物理卷擴(kuò)展到VolGroup00卷組。
- 對(duì)VolGroup00卷組中的LogVolHome邏輯卷進(jìn)行擴(kuò)容。
- 對(duì)LogVolHome邏輯卷上的文件系統(tǒng)進(jìn)行擴(kuò)容。
## 添加硬盤(pán)后記得重啟Linux
fdisk -l | grep /dev/sdd
Disk /dev/sdd: 268 MB, 268435456 bytes, 524288 sectors
fdisk /dev/sdd
Command (m for help): n
Partition type:p primary (0 primary, 0 extended, 4 free)e extended
Select (default p):
Using default response p
Partition number (1-4, default 1):
First sector (2048-524287, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-524287, default 524287):
Using default value 524287
Partition 1 of type Linux and of size 255 MiB is set# 更改分區(qū)類(lèi)型為8e
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'# 保存修改并退出
Command (m for help): w# 創(chuàng)建物理卷
pvcreate /dev/sdd1
# Physical volume "/dev/sdd1" successfully created.
# 擴(kuò)展卷組
vgextend /dev/VolGroup00 /dev/sdd1
# Volume group "VolGroup00" successfully extended
# 擴(kuò)展邏輯卷大小
lvextend -L +256M /dev/VolGroup00/LogVolHome
# 擴(kuò)展文件系統(tǒng)
e2fsck -f /dev/VolGroup00/LogVolHome
resize2fs /dev/VolGroup00/LogVolHome##或者可以在擴(kuò)展邏輯卷時(shí)一鍵擴(kuò)展文件系統(tǒng),只需要加上參數(shù)-r
lvextend -L +1M -r /dev/VolGroup00/LogVolHome
# Rounding size to boundary between physical extents: 4.00 MiB.
# fsck from util-linux 2.23.2
# /dev/mapper/VolGroup00-LogVolHome: clean, 11/141680 files, 28397/569344 blocks
# Size of logical volume VolGroup00/LogVolHome changed from 556.00 MiB (139 extents) to 560.00 MiB (140 extents).
# Logical volume VolGroup00/LogVolHome successfully resized.
#resize2fs 1.42.9 (28-Dec-2013)
#Resizing the filesystem on /dev/mapper/VolGroup00-LogVolHome to 573440 (1k) blocks.
#The filesystem on /dev/mapper/VolGroup00-LogVolHome is now 573440 blocks long.