廢話不多說,直接上操作步驟
操作步驟
前提條件:在操作開始前,請先安裝插件jviewer,在后邊遠(yuǎn)程登錄服務(wù)器時會用到
在物理服務(wù)器上安裝linux系統(tǒng)CentOS 7.4
1、在瀏覽器打開并登錄已經(jīng)配置好的服務(wù)器地址https://xx.xx.xx.xx
2、在界面左側(cè)導(dǎo)航欄中打開遠(yuǎn)程控制--控制臺重定向(KVM)

3、點(diǎn)擊下邊的“Launch KVM Java Viewer”打開jviewer控制臺;點(diǎn)擊上邊的“Launch KVM HTML5 Viewer”按鈕,會在瀏覽器中打開h5頁面
4、在jviewer控制臺中點(diǎn)擊下圖中的按鈕,會彈出一個“Virtual Media”彈窗

5、在彈窗中點(diǎn)擊Browse,在本地選擇已經(jīng)下載好的系統(tǒng)文件(這里以我安裝的CentOS 7.4為例),然后點(diǎn)擊Connect,確認(rèn)之后關(guān)閉彈窗
6、在jviewer控制臺中,點(diǎn)擊“Power-Reset Server”重新啟動服務(wù)器。
7、在服務(wù)器啟動時,根據(jù)提示點(diǎn)擊F11進(jìn)入系統(tǒng)BIOS,在Please select boot device彈窗中選擇“UEFI:IEI Virtual CDromo 1.00”,然后再新界面選擇Install?CentOS 7,然后開始安裝系統(tǒng),如下圖


8、系統(tǒng)安裝完成后,進(jìn)行DATE&TIME,SOFTWARE SELECTION及INSTALLATION DESTINATION等系統(tǒng)設(shè)置
9、在INSTALLATION DESTINATION界面選擇I will configure partitioning,界面自動跳轉(zhuǎn)至MANUAL PARTITIONING界面

10、在MANUAL PARTITIONING界面,在下拉框中選擇Standard Partition,然后根據(jù)具體要求開始分區(qū),我這邊按照下邊的要求進(jìn)行
/boot/EFI??500M
SWAP 50G
剩下的給根目錄,根目錄系統(tǒng)文件格式設(shè)置為ext4



11、分區(qū)完成后,繼續(xù)安裝,并設(shè)置服務(wù)器root登錄密碼
12、等待安裝完成后,點(diǎn)擊“Reboot”重啟系統(tǒng),同時,再次在jviewer控制臺中點(diǎn)擊彈出“Virtual Media”彈窗,并且點(diǎn)擊“Disconnect”斷開連接 ,至此物理服務(wù)器系統(tǒng)安裝完畢。系統(tǒng)重啟后,遠(yuǎn)程使用root及新設(shè)置的密碼可以正常登錄

創(chuàng)建RAID0盤
1、在瀏覽器打開并登錄已經(jīng)配置好的服務(wù)器地址https://xx.xx.xx.xx
2、在界面左側(cè)導(dǎo)航欄中打開存儲--邏輯磁盤
3、點(diǎn)擊“創(chuàng)建虛擬硬盤”,創(chuàng)建RAID0盤



劃分分區(qū)并掛載磁盤
場景示例:云服務(wù)器掛載了一塊新的數(shù)據(jù)盤,需要將該數(shù)據(jù)盤設(shè)為主分區(qū),文件系統(tǒng)設(shè)為ext4格式,掛載在“/mnt/sdc”目錄下,并設(shè)置開機(jī)啟動自動掛載。
執(zhí)行以下命令,查看新增數(shù)據(jù)盤。
fdisk -l
回顯類似如下信息,表示當(dāng)前的云服務(wù)器有兩塊磁盤,“/dev/xvda”是系統(tǒng)盤,“/dev/xvdb”是新增數(shù)據(jù)盤。
[root@ecs-b656 test]#fdisk -lDisk /dev/xvda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000cc4ad
Device Boot Start End Blocks Id System
/dev/xvda1 * 2048 2050047 1024000 83 Linux
/dev/xvda2 2050048 22530047 10240000 83 Linux
/dev/xvda3 22530048 24578047 1024000 83 Linux
/dev/xvda4 24578048 83886079 29654016 5 Extended
/dev/xvda5 24580096 26628095 1024000 82 Linux swap / Solaris
Disk /dev/xvdb: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
執(zhí)行以下命令,進(jìn)入fdisk模式,開始對新增數(shù)據(jù)盤執(zhí)行分區(qū)操作。
fdisk新增數(shù)據(jù)盤
以新掛載的數(shù)據(jù)盤“/dev/xvdb”為例:
fdisk /dev/xvdb
回顯類似如下信息:
[root@ecs-b656 test]#fdisk /dev/xvdb
Welcome to fdisk (util-Linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xb00005bd.
Command (m for help):
輸入“n”,按“Enter”,開始新建分區(qū)。
輸入“n”表示新增一個分區(qū)。
回顯類似如下信息,表示磁盤有兩種分區(qū)類型:
“p”表示主要分區(qū)。
“e”表示延伸分區(qū)。
Command (m for help):n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
以創(chuàng)建一個主要分區(qū)為例,輸入“p”,按“Enter”,開始創(chuàng)建一個主分區(qū)。
回顯類似如下信息,“Partition number”表示主分區(qū)編號,可以選擇1-4。
Select (default p):p
Partition number (1-4, default 1):
以分區(qū)編號選擇“1”為例,輸入主分區(qū)編號“1”,直接按“Enter”。
回顯類似如下信息,“First sector”表示初始磁柱區(qū)域,可以選擇2048-20971519,默認(rèn)為2048。
Partition number (1-4, default 1):1
First sector (2048-20971519, default 2048):
以選擇默認(rèn)初始磁柱編號2048為例,直接按“Enter”。
回顯類似如下信息,“Last sector”表示截止磁柱區(qū)域,可以選擇2048-20971519,默認(rèn)為20971519。
First sector (2048-20971519, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519):
以選擇默認(rèn)截止磁柱編號20971519為例,直接按“Enter”。
回顯類似如下信息,表示分區(qū)完成,即為10GB的數(shù)據(jù)盤新建了1個分區(qū)。
Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519):
Using default value 20971519
Partition 1 of type Linux and of size 10 GiB is set
Command (m for help):
輸入“p”,按“Enter”,查看新建分區(qū)的詳細(xì)信息。
回顯類似如下信息,表示新建分區(qū)“/dev/xvdb1”的詳細(xì)信息。
Command (m for help): p
Disk /dev/xvdb: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xb00005bd
Device Boot Start End Blocks Id System/dev/xvdb1 2048 20971519 10484736 83 Linux
Command (m for help):
輸入“w”,按“Enter”,將分區(qū)結(jié)果寫入分區(qū)表中。
回顯類似如下信息,表示分區(qū)創(chuàng)建完成。
Command (m for help):wThe partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
執(zhí)行以下命令,將新建分區(qū)文件系統(tǒng)進(jìn)行系統(tǒng)格式化。
?? ??? ??? ?mkfs -t文件系統(tǒng)格式/dev/xvdb1
?? ??? ??? ?以設(shè)置文件系統(tǒng)為“ext4”為例:
?? ??? ??? ?mkfs -t ext4 /dev/xvdb1
?? ??? ??? ?回顯類似如下信息:
?? ??? ??? ?[root@ecs-b656 test]#mkfs -t ext4 /dev/xvdb1
?? ??? ??? ?mke2fs 1.42.9 (28-Dec-2013)
?? ??? ??? ?Filesystem label=
?? ??? ??? ?OS type: Linux
?? ??? ??? ?Block size=4096 (log=2)
?? ??? ??? ?Fragment size=4096 (log=2)
?? ??? ??? ?Stride=0 blocks, Stripe width=0 blocks
?? ??? ??? ?655360 inodes, 2621184 blocks
?? ??? ??? ?131059 blocks (5.00%) reserved for the super user
?? ??? ??? ?First data block=0
?? ??? ??? ?Maximum filesystem blocks=2151677952
?? ??? ??? ?80 block groups
?? ??? ??? ?32768 blocks per group, 32768 fragments per group
?? ??? ??? ?8192 inodes per group
?? ??? ??? ?Superblock backups stored on blocks:
?? ??? ??? ?32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
?? ??? ??? ?Allocating group tables: doneWriting inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done
?? ??? ??? ?格式化需要等待一段時間,請觀察系統(tǒng)運(yùn)行狀態(tài),不要退出。
cd到根目錄下
?? ??? ?? ? cd ..
執(zhí)行以下命令,新建掛載路徑。
?? ??? ??? ?mkdir掛載路徑
?? ??? ??? ?以新建掛載路徑“/mnt/sdc”為例:
?? ??? ??? ?mkdir /mnt/sdc
執(zhí)行以下命令,將新建分區(qū)掛載到11中新建的路徑下。
?? ??? ??? ?mount /dev/xvdb1掛載路徑
?? ??? ??? ?以掛載新建分區(qū)至“/mnt/sdc”為例:
?? ??? ??? ?mount /dev/xvdb1 /mnt/sdc
執(zhí)行以下命令,查看掛載結(jié)果。
?? ??? ??? ?df -TH
?? ??? ??? ?回顯類似如下信息,表示新建分區(qū)“/dev/xvdb1”已掛載至“/mnt/sdc”。
?? ??? ??? ?[root@ecs-b656 test]#df -TH
?? ??? ??? ?Filesystem Type Size Used Avail Use% Mounted on
?? ??? ??? ?/dev/xvda2 xfs 11G 7.4G 3.2G 71% /
?? ??? ??? ?devtmpfs devtmpfs 4.1G 0 4.1G 0% /dev
?? ??? ??? ?tmpfs tmpfs 4.1G 82k 4.1G 1% /dev/shm
?? ??? ??? ?tmpfs tmpfs 4.1G 9.2M 4.1G 1% /run
?? ??? ??? ?tmpfs tmpfs 4.1G 0 4.1G 0% /sys/fs/cgroup
?? ??? ??? ?/dev/xvda3 xfs 1.1G 39M 1.1G 4% /home
?? ??? ??? ?/dev/xvda1 xfs 1.1G 131M 915M 13% /boot
?? ??? ??? ?/dev/xvdb1 ext4 11G 38M 9.9G 1% /mnt/sdc
設(shè)置開機(jī)自動掛載磁盤
如果需要服務(wù)器系統(tǒng)啟動時自動掛載磁盤,不能采用在 /etc/fstab直接指定 /dev/xvdb1的方法,因?yàn)樵O(shè)備的順序編碼在關(guān)閉或者開啟服務(wù)器過程中可能發(fā)生改變。推薦使用UUID來配置自動掛載數(shù)據(jù)盤。
說明:
磁盤的UUID(universally unique identifier)是Linux系統(tǒng)為存儲設(shè)備提供的唯一的標(biāo)識字符串。
執(zhí)行如下命令,查詢磁盤分區(qū)的UUID。
blkid磁盤分區(qū)
以查詢磁盤分區(qū)“/dev/xvdb1”的UUID為例:
blkid /dev/xvdb1
回顯類似如下信息,表示“/dev/xvdb1”的UUID。
[root@ecs-b656 test]#blkid /dev/xvdb1
/dev/xvdb1: UUID="1851e23f-1c57-40ab-86bb-5fc5fc606ffa" TYPE="ext4"
執(zhí)行以下命令,使用VI編輯器打開“fstab”文件。
vi /etc/fstab
按“i”,進(jìn)入編輯模式。
將光標(biāo)移至文件末尾,按“Enter”,添加如下內(nèi)容。
UUID=1851e23f-1c57-40ab-86bb-5fc5fc606ffa /mnt/sdc ext4 defaults 0 2
按“ESC”后,輸入“:wq”,按“Enter”。
保存設(shè)置并退出編輯器。