本文以新網(wǎng)的云主機(jī)為例,并為安裝WDCP網(wǎng)站管理程序準(zhǔn)備而提供
*建議云主機(jī)為阿里云ecs t5或者新網(wǎng)云3以上,操作系統(tǒng)選擇(linux 64位(centos7.6,centos 6.4等,純凈系統(tǒng))
*系統(tǒng)要求只為方便安裝WDCP,有更好的支持
1、通過(guò)Linux SSH 登陸軟件:(PuTTY 簡(jiǎn)體中文版)登陸我們的云主機(jī)。
2、 查看新硬盤(pán):
[root@~]# df -h //檢查當(dāng)前掛載磁盤(pán)
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 14G 3.4G 9.4G 27% /
/dev/sda1 99M 12M 83M 13% /boot
tmpfs 252M 0 252M 0% /dev/shm
[root@~]#
[root@~]# fdisk -l //檢查當(dāng)前分區(qū),下面紅色的sbd是沒(méi)有分區(qū)的,需要下一步操作
Disk /dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 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 144 1052257 + 82 Linux swap / Solaris
/dev/sda3 145 1958 14570955 83 Linux
Disk /dev/sdb: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn’t contain a valid partition table
[root@~]#
這時(shí)會(huì)看到有16G的sdb(Disk /dev/sdb: 16.1 GB)沒(méi)有分配,可以按照下面的方法繼續(xù)分配,由于實(shí)際分配的不一定是sdb(有可能是hdc或hdd等),下面的操作都是以系統(tǒng)顯示為sdb來(lái)做下面的操作。
對(duì)sdb做分區(qū):
[root@ ~]# fdisk /dev/sdb //對(duì)sdb做分區(qū)
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 won’t be recoverable.
The number of cylinders for this disk is set to 1958.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n //繼續(xù)下一步輸入n
Command action
e extended
p primary partition (1-4)p //輸入p
Partition number (1-4): //輸入1
First cylinder (1-1958, default 1): //回車
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1958, default 1958): //回車
Using default value 1958
Command (m for help): w //輸入w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
You have mail in /var/spool/mail/root
[root@ ~]#
3、 格式化:
[root@ ~]# fdisk -l //確認(rèn)剛分區(qū)的是否存在(下面紅色部分就是我們剛分區(qū)并要繼續(xù)格式化的磁盤(pán)點(diǎn))
Disk /dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 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 144 1052257+ 82 Linux swap / Solaris
/dev/sda3 145 1958 14570955 83 Linux
Disk /dev/sdb: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1958 15727603+ 83 Linux
[root@ ~]#
[root@~]# mkfs.ext3 /dev/sdb1 //格式化sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1966080 inodes, 3931900 blocks
196595 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4026531840
120 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@~]#
4、 掛載分區(qū):
[root@~]# mkdir /user1 //創(chuàng)建需要掛載的分區(qū)目錄,可以自定義
[root@~]# mount /dev/sdb1 /user1/ //掛載剛創(chuàng)建的目錄
[root@~]# df -h //確定是否掛載成功,和第一步比較
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 14G 3.5G 9.4G 27% /
/dev/sda1 99M 12M 83M 13% /boot
tmpfs 252M 0 252M 0% /dev/shm
/dev/sdb1 15G 166M 14G 2% /user1
[root@~]#
5、 配置自動(dòng)掛載(重啟服務(wù)器會(huì)后自動(dòng)加載上):
[root@ ~]# cat /etc/fstab //查看當(dāng)前加載情況
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
[root@ ~]#vi /etc/fstab //編輯fatab文件并加入下面一行
/dev/sdb1 /user1 ext3 defaults,noatime 0 0
[root@SZNC-DB-4120 ~]# cat /etc/fstab //確認(rèn)是否已加入(紅色部分)
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
/dev/sdb1 /user1 ext3 defaults,noatime 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
[root@SZNC-DB-4120 ~]#
6.好了,我們分區(qū)到此就完成了,如果是阿里云服務(wù)器,建議先配置開(kāi)放端口,參考:http://ne02.cn/new_235.html 阿里云端口配置
7.好了,我們分區(qū)到此就完成了,如果安裝運(yùn)行環(huán)境就參考本站的WDCP安裝方法!
遼公網(wǎng)安備21010402000436號(hào)
遼ICP備14018187號(hào)-7
網(wǎng)上亮照 電子執(zhí)照
安全有保障更放心
