centos by path forest path

大家好,今天小编来为大家解答以下的问题,关于centos by path,forest path这个很多人还不知道,现在让我们一起来看看吧!

CentOS7网络设置修复

服务器有两个网卡enp7s0和enp8s0   

服务器需要通过enp8s0和互联网联通,互联网为笔记本转接

通过centos7界面修改ip,失败;

通过centos7的网络配置文件/etc/sysconfig/network-scripts/ifcfg-enp8s0修改ip设置

设置如下:

1.启动 service network start报错,通过journalctl-xe查看如下

-- Defined-By: systemd

-- Support:

--

-- Unit fprintd.service has begun starting up.

12月 29 19:31:12 crrchost dbus-daemon[851]: dbus[851]: [system] Successfully activated service'net.reactivated.Fprint'

12月 29 19:31:12 crrchost dbus[851]: [system] Successfully activated service'net.reactivated.Fprint'

12月 29 19:31:12 crrchost systemd[1]: Started Fingerprint Authentication Daemon.

-- Subject: Unit fprintd.service has finished start-up

-- Defined-By: systemd

-- Support:

--

-- Unit fprintd.service has finished starting up.

--

-- The start-up result is done.

12月 29 19:31:12 crrchost fprintd[6685]: Launching FprintObject

12月 29 19:31:12 crrchost fprintd[6685]:** Message: D-Bus service launched with name: net.reactivated.Fprint

12月 29 19:31:12 crrchost fprintd[6685]:** Message: entering main loop

12月 29 19:31:18 crrchost polkitd[835]: Operator of unix-session:1 successfully authenticated as unix-user:windfarm to gain TEMPORARY authorization for action org.freedesktop.systemd1.manage-units for system-bus

12月 29 19:31:18 crrchost systemd[1]: Starting LSB: Bring up/down networking...

-- Subject: Unit network.service has begun start-up

-- Defined-By: systemd

-- Support:

--

-- Unit network.service has begun starting up.

12月 29 19:31:18 crrchost network[6693]:正在打开环回接口: [ 确定  ]

12月 29 19:31:18 crrchost network[6693]:正在打开接口 enp7s0:

12月 29 19:31:24 crrchost network[6693]:正在确定 enp7s0的 IP信息...失败:不存在链接。检查电缆?

12月 29 19:31:24 crrchost network[6693]: [失败]

12月 29 19:31:24 crrchost network[6693]:正在打开接口 enp8s0: RTNETLINK answers: File exists

12月 29 19:31:25 crrchost network[6693]: [ 确定  ]

12月 29 19:31:25 crrchost network[6693]: RTNETLINK answers: File exists

12月 29 19:31:25 crrchost network[6693]: RTNETLINK answers: File exists

12月 29 19:31:25 crrchost network[6693]: RTNETLINK answers: File exists

12月 29 19:31:25 crrchost network[6693]: RTNETLINK answers: File exists

12月 29 19:31:25 crrchost network[6693]: RTNETLINK answers: File exists

12月 29 19:31:25 crrchost network[6693]: RTNETLINK answers: File exists

12月 29 19:31:25 crrchost network[6693]: RTNETLINK answers: File exists

12月 29 19:31:25 crrchost network[6693]: RTNETLINK answers: File exists

12月 29 19:31:25 crrchost network[6693]: RTNETLINK answers: File exists

12月 29 19:31:25 crrchost systemd[1]: network.service: control process exited, code=exited status=1

12月 29 19:31:25 crrchost systemd[1]: Failed to start LSB: Bring up/down networking.

-- Subject: Unit network.service has failed

-- Defined-By: systemd

-- Support:

--

-- Unit network.service has failed.

--

-- The result is failed.

12月 29 19:31:25 crrchost systemd[1]: Unit network.service entered failed state.

12月 29 19:31:25 crrchost systemd[1]: network.service failed.

12月 29 19:31:25 crrchost polkitd[835]: Unregistered Authentication Agent for unix-process:6669:319312(system bus name:1.263, object path/org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8)(d

3.systemctl status network.service查看如下:

● network.service- LSB: Bring up/down networking

  Loaded: loaded(/etc/rc.d/init.d/network; bad; vendor preset: disabled)

  Active: failed(Result: exit-code) since六 2018-12-29 18:38:17 CST; 1min 24s ago

   Docs: man:systemd-sysv-generator(8)

  Process: 909 ExecStart=/etc/rc.d/init.d/network start(code=exited, status=1/FAILURE)

12月 29 18:38:06 crrchost systemd[1]: Starting LSB: Bring up/down networking...

12月 29 18:38:06 crrchost network[909]:正在打开环回接口: [ 确定  ]

12月 29 18:38:06 crrchost network[909]:正在打开接口 enp7s0:

12月 29 18:38:12 crrchost network[909]:正在确定 enp7s0的 IP信息...失败:…?

12月 29 18:38:12 crrchost network[909]: [失败]

12月 29 18:38:17 crrchost network[909]:正在打开接口 enp8s0: [ 确定  ]

12月 29 18:38:17 crrchost systemd[1]: network.service: control process exi...=1

12月 29 18:38:17 crrchost systemd[1]: Failed to start LSB: Bring up/down n...g.

12月 29 18:38:17 crrchost systemd[1]: Unit network.service entered failed...e.

12月 29 18:38:17 crrchost systemd[1]: network.service failed.

Hint: Some lines were ellipsized, use-l to show in full.

1.参考网络方法停用NetworkManager,依旧报错

   systemctl stop NetworkManager

    systemctl disable NetworkManager

2.比对两个网卡的MAC地址和配置文件的MAC地址

   a.查看mac地址配置,ipconfig

   b.查看配置文件中的macd地址是否匹配,ifcfg-enp8s0和ifcfg-enp7s0,

    按照网络方法增加一行HWADDR=ipconfig查询到的对应网卡MAC地址;

   c.重启network服务依旧报错;

3.通过GUI界面查看网络,提示“系统的网络服务与此版本的网络管理器不兼容”

  这与之前停掉NetworkManager有关,此处不表;

4.因为ifcfg-enp7s0实际上没有插网线,修正其配置文件如下:

   ONBOOT=no

  重新启动服务后网络正常;

5.检查网络

1.network和NetworkManager不同,通过界面和通过配置文件,可能会导致配置混乱,且NetworkManager有些程序不支持,需要停用;

2.BOOTPROTO=none虽然可以表示静态ip,但是如果要启用,必须设置其为

BOOTPROTO=static或BOOTPROTO=dhcp

3.一个网卡没哟被启用,也就是没有设置动态ip或静态ip,是无法被初始化的,不能设置ONBOOT=yes

In Centos7.0 disabling NetworkManager will leave a dhcp client running configured for NetworkManager. This causes the error message RTNETLINK answers: File exists when the network service is started.

The stale dhclient process has the additional"benefit" that when the lease expires your dhclientwill choke, since it cannot reach NetWorkManager, thus removing your IP address.

If you grep for it, you will see that it points to a NetWorkManager configuration file.

[root@host~]# ps-ef| grep dhc

root    1865  792  0 Apr28?     00:00:00/sbin/dhclient-d-sf\

/usr/libexec/nm-dhcp-helper-pf/var/run/dhclient-eno1.pid-lf\

/var/lib/NetworkManager/dhclient-c96e56d3-a4c9-4a87-85ca-93dc0ca268f2-eno1.lease\

-cf/var/lib/NetworkManager/dhclient-eno1.conf eno1

So what you can do is kill the dhclient and only then start your network service.

centos5 源码安装Nginx + mysql + apache + php的方法

主要依照的是张宴的一篇博文《》,安装的软件是也是从他提供的列表中下载,这里都是tar.gz格式,如果更希望是rpm格式的话,提供一个网址《》这里列出了比较完全的下载包。

我安装的系统:Centos5

1、下载;

我安装的下载来自张宴博文下的地址,下载保存的是home下自己目录的一个文件夹下:

复制代码

   

代码如下:

cd/home/xuxx/software

   wget

   wget

   wget

   wget

   wget

   wget

   wget

   wget

   wget

   wget

   wget

   wget

   wget

   wget

2、准备编译安装环境,需要编译源码用到gc++

建议如果是新安装的系统,使用yum upgrade更新下系统。

复制代码

   

代码如下:

sudo-s

   LANG=C

   yum-y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel

   glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel

   openldap openldap-devel nss_ldap openldap-clients openldap-servers

注意:这里所有的命令是一行的而不能有换行符,如果是copy的时候,注意要去处该换行符

确保安装成功!才能正确使用编译。

3、安装:

一、安装PHP 5.2.8(FastCGI模式)

1、编译安装PHP 5.2.8所需的支持库:

1] libiconv库

复制代码

   

代码如下:

tar zxvf libiconv-1.13.tar.gz

   cd libiconv-1.13/

   ./configure--prefix=/usr/local

   make

   make install

   make clean

   make distclean

   cd../

make clean和make distclean都是删除安装过程中生成的缓存文件。当然如果你不介意放着也可以跳过这两步清理操作。

2]libmcrypt库

复制代码

   

代码如下:

tar zxvf libmcrypt-2.5.8.tar.gz

   cd libmcrypt-2.5.8/

   ./configure

   make

   make install

   make clean

   make distclean

   /sbin/ldconfig

   cd libltdl/

   ./configure--enable-ltdl-install

   make

   make install

   make clean

   make distclean

   cd

3] mhash库

复制代码

   

代码如下:

tar zxvf mhash-0.9.9.9.tar.gz

   cd mhash-0.9.9.9/

   ./configure

   make

   make install

   cd../

4]mcrypt库

注意:因为该库和libmcrypt有依赖性,所以在安装前必须知道libmcrypt,否则的话会出现:

错误

复制代码

   

代码如下:

checking for libmcrypt– version= 2.5.0…

   ***‘libmcrypt-config–version’ returned 2.4.0, but LIBMCRYPT(2.5.8)

   *** was found! If libmcrypt-config was correct, then it is best

   *** to remove the old version of LIBMCRYPT. You may also be able to fix the error

   *** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing

   ***/etc/ld.so.conf. Make sure you have run ldconfig if that is

   *** required on your system.

   *** If libmcrypt-config was wrong, set the environment variable LIBMCRYPT_CONFIG

   *** to point to the correct copy of libmcrypt-config, and remove the file config.cache

   *** before re-running configure

   configure: error:*** libmcrypt was not found

是因为path的问题,所以执行:

复制代码

   

代码如下:

ln-s/usr/local/lib/libmcrypt.la/usr/lib/libmcrypt.la

   ln-s/usr/local/lib/libmcrypt.so/usr/lib/libmcrypt.so

   ln-s/usr/local/lib/libmcrypt.so.4/usr/lib/libmcrypt.so.4

   ln-s/usr/local/lib/libmcrypt.so.4.4.8/usr/lib/libmcrypt.so.4.4.8

   ln-s/usr/local/lib/libmhash.a/usr/lib/libmhash.a

   ln-s/usr/local/lib/libmhash.la/usr/lib/libmhash.la

   ln-s/usr/local/lib/libmhash.so/usr/lib/libmhash.so

   ln-s/usr/local/lib/libmhash.so.2/usr/lib/libmhash.so.2

   ln-s/usr/local/lib/libmhash.so.2.0.1/usr/lib/libmhash.so.2.0.1

   ln-s/usr/local/bin/libmcrypt-config/usr/bin/libmcrypt-config

然后再安装:

复制代码

   

代码如下:

tar zxvf mcrypt-2.6.8.tar.gz

   cd mcrypt-2.6.8/

   /sbin/ldconfig

   ./configure

   make

   make install

   cd../

二、安装mysql

复制代码

   

代码如下:

/usr/sbin/groupadd mysql

   /usr/sbin/useradd-g mysql xxx

   unzip mysql-5.1.33.zip

   cd mysql-5.1.33/

   ./configure--prefix=/usr/local/webserver/mysql/--enable-assembler--with-extra-charsets=complex--enable-thread-safe-client--with-big-tables

   --with-readline--with-ssl--with-embedded-server--enable-local-infile--with-plugins=innobase

   make

   make install

   make clean

   make distclean

   chmod+w/usr/local/webserver/mysql

   chown-R xxx:mysql/usr/local/webserver/mysql

   cp support-files/my-medium.cnf.sh/usr/local/webserver/mysql/my.cnf

   cd../

注意:这里编译./configure命令是一行的而不能有换行符,如果是copy的时候,注意要去处该换行符

在最后一步拷贝的时候,我安装完在support-files下没有my-medium.cnf而只有my-medium.cnf.sh所以将这个文件拷贝过去。

@张宴原文:

附:以下为附加步骤,如果你想在这台服务器上运行MySQL数据库,则执行以下两步。如果你只是希望让PHP支持MySQL扩展库,能够连接其他服务器上的MySQL数据库,那么,以下两步无需执行。

①、以xxx用户帐号的身份建立数据表:

复制代码

   

代码如下:

/usr/local/webserver/mysql/bin/mysql_install_db--basedir=/usr/local/webserver/mysql--datadir=/usr/local/webserver/mysql/data--user=xxx

②、启动MySQL(最后的表示在后台运行)

复制代码

   

代码如下:

/bin/sh/usr/local/webserver/mysql/bin/mysqld_safe--defaults-file=/usr/local/webserver/mysql/my.cnf

3、编译安装PHP(FastCGI模式)

复制代码

   

代码如下:

tar zxvf php-5.2.8.tar.gz

   gzip-cd php-5.2.8-fpm-0.5.10.diff.gz| patch-d php-5.2.8-p1

   cd php-5.2.8/

   ./configure--prefix=/usr/local/webserver/php--with-config-file-path=/usr/local/webserver/php/etc--with-mysql=/usr/local/webserver/mysql

   --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config--with-iconv-dir=/usr/local--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib

   --with-libxml-dir=/usr--enable-xml--disable-rpath--enable-discard-path--enable-safe-mode--enable-bcmath--enable-shmop--enable-sysvsem

   --enable-inline-optimization--with-curl--with-curlwrappers--enable-mbregex--enable-fastcgi--enable-fpm--enable-force-cgi-redirect

   --enable-mbstring--with-mcrypt--with-gd--enable-gd-native-ttf--with-openssl--with-mhash--enable-pcntl--enable-sockets--with-ldap

   --with-ldap-sasl

   make ZEND_EXTRA_LIBS='-liconv'

   make install

   cp php.ini-dist/usr/local/webserver/php/etc/php.ini

   cd../

注意:这里./configure命令是一行的而不能有换行符,如果是copy的时候,注意要去处该换行符

4、编译安装PHP5扩展模块--可选安装

复制代码

   

代码如下:

tar zxvf memcache-2.2.5.tgz

   cd memcache-2.2.5/

   /usr/local/webserver/php/bin/phpize

   ./configure--with-php-config=/usr/local/webserver/php/bin/php-config

   make

   make install

   make clean

   make distclean

   cd../

   tar jxvf eaccelerator-0.9.5.3.tar.bz2

   cd eaccelerator-0.9.5.3/

   /usr/local/webserver/php/bin/phpize

   ./configure--enable-eaccelerator=shared--with-php-config=/usr/local/webserver/php/bin/php-config

   make

   make install

   make clean

   make distclean

   cd../

   tar zxvf PDO_MYSQL-1.0.2.tgz

   cd PDO_MYSQL-1.0.2/

   /usr/local/webserver/php/bin/phpize

   ./configure--with-php-config=/usr/local/webserver/php/bin/php-config--with-pdo-mysql=/usr/local/webserver/mysql

   make

   make install

   make clean

   make distclean

   cd../

   tar zxvf ImageMagick.tar.gz

   cd ImageMagick-6.5.1-2/

   ./configure

   make

   make install

   make clean

   make distclean

   cd../

   tar zxvf imagick-2.2.2.tgz

   cd imagick-2.2.2/

   /usr/local/webserver/php/bin/phpize

   ./configure--with-php-config=/usr/local/webserver/php/bin/php-config

   make

   make install

   make clean

   make distclean

   cd../

5、修改php.ini文件

STRONG手工修改:/STRONG查找/usr/local/webserver/php/etc/php.ini中的extension_dir="./"

修改为extension_dir="/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/"

并在此行后增加以下几行,然后保存:

extension="memcache.so"

extension="pdo_mysql.so"

extension="imagick.so"

再查找output_buffering= Off

修改为output_buffering= On

6、配置eAccelerator加速PHP:

mkdir-p/usr/local/webserver/eaccelerator_cache

vi/usr/local/webserver/php/etc/php.ini

按shift+g键跳到配置文件的最末尾,加上以下配置信息:

复制代码

   

代码如下:

[eaccelerator]

   zend_extension="/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"

   eaccelerator.shm_size="128"

   eaccelerator.cache_dir="/usr/local/webserver/eaccelerator_cache"

   eaccelerator.enable="1"

   eaccelerator.optimizer="1"

   eaccelerator.check_mtime="1"

   eaccelerator.debug="0"

   eaccelerator.filter=""

   eaccelerator.shm_max="0"

   eaccelerator.shm_ttl="300"

   eaccelerator.shm_prune_period="120"

   eaccelerator.shm_only="0"

   eaccelerator.compress="1"

   eaccelerator.compress_level="9"

修改配置文件:

vi/etc/sysctl.conf

kernel.shmmax= 134217728

然后执行以下命令使配置生效:/sbin/sysctl-p

以下的步骤和张宴步骤中一样配置,不再赘诉

CentOS下多路径大容量硬盘挂载详解

一、应用环境及需求刀片服务器通过光纤交换机连接HP存储,形成了一个2X2的链路。操作系统为CentOS 6.4 64位挂载的存储容量为2.5T

基于此应用环境,需要解决两个问题:

为保证链路的稳定性及传输性能等,可以使用多路径技术;挂载的存储硬盘超过了2T,MBR分区格式不能支持,需要使用到GPT分区格式

因为CentOS 6.4中已经自带了HP存储的驱动,会自动识别出挂载的存储硬盘,否则的话,需要先安装存储驱动。

二、什么是多路径

普通的电脑主机都是一个硬盘挂接到一个总线上,这里是一对一的关系。而到了有光纤组成的SAN环境,或者由iSCSI组成的IPSAN环境,由于主机和存储通过了光纤交换机或者多块网卡及IP来连接,这样的话,就构成了多对多的关系。也就是说,主机到存储可以有多条路径可以选择。主机到存储之间的IO由多条路径可以选择。每个主机到所对应的存储可以经过几条不同的路径,如果是同时使用的话,I/O流量如何分配?其中一条路径坏掉了,如何处理?还有在操作系统的角度来看,每条路径,操作系统会认为是一个实际存在的物理盘,但实际上只是通向同一个物理盘的不同路径而已,这样是在使用的时候,就给用户带来了困惑。多路径软件就是为了解决上面的问题应运而生的。

多路径的主要功能就是和存储设备一起配合实现如下功能:

1.故障的切换和恢复

2.IO流量的负载均衡

3.磁盘的虚拟化

由于多路径软件是需要和存储在一起配合使用的,不同的厂商基于不同的操作系统,都提供了不同的版本。并且有的厂商,软件和硬件也不是一起卖的,如果要使用多路径软件的话,可能还需要向厂商购买license才行。比如EMC公司基于linux下的多路径软件,就需要单独的购买license。好在,RedHat和Suse的2.6的内核中都自带了免费的多路径软件包,并且可以免费使用,同时也是一个比较通用的包,可以支持大多数存储厂商的设备,即使是一些不是出名的厂商,通过对配置文件进行稍作修改,也是可以支持并运行的很好的。

比较直观的感受是在Linux系统中执行fdisk-l命令,会出现类似/dev/sda1、/dev/sdb1、/dev/sdc1、/dev/sdd1的硬盘。因为总共有四种组合的路径,Linux系统会将每跳链路都认为是挂载了一块硬盘。

三、Linux下multipath介绍

CentOS 6.4中,默认已经安装了multipath:

[root@localhost~]# rpm-qa|grep mapper device-mapper-multipath-0.4.9-64.el6.x86_64 device-mapper-event-libs-1.02.77-9.el6.x86_64 device-mapper-multipath-libs-0.4.9-64.el6.x86_64 device-mapper-persistent-data-0.1.4-1.el6.x86_64 device-mapper-libs-1.02.77-9.el6.x86_64 device-mapper-event-1.02.77-9.el6.x86_64 device-mapper-1.02.77-9.el6.x86_64

device-mapper-multipath:即multipath-tools。主要提供multipathd和multipath等工具和 multipath.conf等配置文件。这些工具通过device mapper的ioctr的接口创建和配置multipath设备(调用device-mapper的用户空间库,创建的多路径设备会在/dev/mapper中)。

device-mapper:主要包括两大部分:内核部分和用户部分。

其中内核部分主要由device mapper核心(dm.ko)和一些target driver(md-multipath.ko)。核心完成设备的映射,而target根据映射关系和自身特点具体处理从mappered device下来的i/o。同时,在核心部分,提供了一个接口,用户通过ioctr可和内核部分通信,以指导内核驱动的行为,比如如何创建mappered device,这些divece的属性等。linux device mapper的用户空间部分主要包括device-mapper这个包。其中包括dmsetup工具和一些帮助创建和配置mappered device的库。这些库主要抽象,封装了与ioctr通信的接口,以便方便创建和配置mappered device。multipath-tool的程序中就需要调用这些库。

dm-multipath.ko和dm.ko:dm.ko是device mapper驱动。它是实现multipath的基础。dm-multipath其实是dm的一个target驱动。

scsi_id:包含在udev程序包中,可以在multipath.conf中配置该程序来获取scsi设备的序号。通过序号,便可以判断多个路径对应了同一设备。这个是多路径实现的关键。scsi_id是通过sg驱动,向设备发送EVPD page80或page83的inquery命令来查询scsi设备的标识。但一些设备并不支持EVPD的inquery命令,所以他们无法被用来生成multipath设备。但可以改写scsi_id,为不能提供scsi设备标识的设备虚拟一个标识符,并输出到标准输出。multipath程序在创建multipath设备时,会调用scsi_id,从其标准输出中获得该设备的scsi id。在改写时,需要修改scsi_id程序的返回值为0。因为在multipath程序中,会检查该直来确定scsi id是否已经成功得到。

四、配置multipath

基本配置脚本如下:

[root@localhost~]# cat/etc/multipath.conf defaults{ polling_interval 30 failback immediate no_path_retry queue rr_min_io 100 path_checker tur user_friendly_names yes}# SVC device{ vendor IBM product 2145 path_grouping_policy group_by_prio prio_callout/sbin/mpath_prio_alua/dev/%n}

multipath基本操作命令

#/etc/init.d/multipathd start#开启mulitipath服务# multipath-F#删除现有路径# multipath-v2#格式化路径# multipath-ll#查看多路径

如果配置正确的话就会在/dev/mapper/目录下多出mpathbp1等之类的设备,用fdisk-l命令可以看到多路径软件创建的磁盘,如:/dev/mapper/mpathbp1

五、格式化硬盘

执行fdisk-l,可以看到存储已经识别成功,并且多路径配置也正确。信息如下:

[root@localhost~]# fdisk-l...... Disk/dev/mapper/mpathb: 2684.4 GB, 2684354560000 bytes 255 heads, 63 sectors/track, 326354 cylinders Units= cylinders of 16065* 512= 8225280 bytes Sector size(logical/physical): 512 bytes/ 512 bytes I/O size(minimum/optimal): 512 bytes/ 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System/dev/mapper/mpathbp1 1 267350 2147483647+ ee GPT......

通过上面的信息可以发现已经是GPT的分区格式了,接下来就是需要对硬盘进行格式化。如果不是,需要先执行如下步骤:

1.新建分区

[root@localhost~]# pvcreate/dev/mapper/mpathb [root@localhost~]# parted/dev/mapper/mpathb GNU Parted 2.1 Using/dev/mapper/mpathbp1 Welcome to GNU Parted! Type'help' to view a list of commands.(parted) mklabel gpt#设置分区类型为gpt(parted) mkpart extended 0% 100%#扩展分区,并使用整个硬盘(parted) quit#退出 Information: You may need to update/etc/fstab.

2.格式化挂载硬盘

[root@localhost~]# mkfs.ext4/dev/mapper/mpathbp1 [root@localhost~]# mount/dev/mapper/mpathbp1/test

挂载成功后,即可使用了。

3.动挂载分区

当在系统里创建了一个新的分区后,因为mount挂载在重启系统后会失效,所以需要将分区信息写到/etc/fstab文件中让其永久挂载。

[root@localhost~]# vi/etc/fstab/dev/mapper/mpathbp1/test ext4 defaults 1 2

保存退出,重启后/dev/mapper/mpathbp1就会自动挂载到/test目录下

阅读剩余
THE END