沈阳网站制作

400电话办理 | 手机版本
电话咨询热线:024-2322 9211
了解网站建设详情:136 10888 186( 王经理 )

新闻中心/News当前位置:首页 > 行业新闻

云主机分区及挂载方法

  • 分享内容:
    本文发布于:2018-08-10 10:10:12
    目前浏览量:1242 人
    发布人:gary
    版权:沈阳蓝色科技公司

本文以新网的云主机为例,并为安装WDCP网站管理程序准备而提供

*建议云主机为新网云3以上,操作系统选择(linux 64位(centos 6.4,纯净系统)

*系统要求只为方便安装WDCP,有更好的支持

1、通过Linux   SSH 登陆软件:(PuTTY 简体中文版)登陆我们的云主机。


2、 查看新硬盘:

[root@~]# df -h //检查当前挂载磁盘

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 //检查当前分区,下面红色的sbd是没有分区的,需要下一步操作

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@~]#

这时会看到有16GsdbDisk /dev/sdb: 16.1 GB)没有分配,可以按照下面的方法继续分配,由于实际分配的不一定是sdb(有可能是hdchdd等),下面的操作都是以系统显示为sdb来做下面的操作。

sdb做分区

[root@ ~]# fdisk /dev/sdb //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 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 //继续下一步输入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 //确认刚分区的是否存在(下面红色部分就是我们刚分区并要继续格式化的磁盘点)

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、 挂载分区:

[root@~]# mkdir /user1 //创建需要挂载的分区目录,可以自定义

[root@~]# mount /dev/sdb1 /user1/ //挂载刚创建的目录

[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、 配置自动挂载(重启服务器会后自动加载上):

[root@ ~]# cat /etc/fstab //查看当前加载情况

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 //确认是否已加入(红色部分)

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.好了,我们分区到此就完成了,如果安装运行环境就参考本站的WDCP安装方法!


本文信息由沈阳蓝色科技提供,沈阳蓝色科技专业从事网站制作、网站建设等网络服务,蓝色科技以“专业定制,源码开发” 的开发理念领先同行业,完善的售后服务体系,让您无后顾之忧,沈阳蓝色科技值得您信赖的沈阳网站制作公司
上一条:云主机安装WDCP方法
下一条:网站建设那家性价比高

  • 024-23229211