Local系统管理员新增了一个VG,将一个原挂载点/u02改为了/u02-old, 如下所示。
[root@mylnx01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
37G 21G 15G 60% /
/dev/sda1 99M 23M 71M 25% /boot
tmpfs 7.9G 0 7.9G 0% /dev/shm
/dev/mapper/VolGroup02-LogVol20
60G 37G 20G 66% /u03
/dev/mapper/VolGroup03-LogVol30
60G 36G 21G 64% /u04
/dev/mapper/VolGroup04-LogVol40
148G 54G 88G 38% /u02
/dev/mapper/VolGroup01-LogVol10
60G 54G 3.0G 95% /u02-old
但是这个挂载点/u02-old(挂载目录)不是我们想要的,现在我们需要修改挂载目录名称,那么如何做呢?下面是操作步骤。
步骤1 :umount这个设备或挂载目录,如下所示
[root@mylnx01 ~]# umount /u02-old
umount: /u02-old: device is busy
umount: /u02-old: device is busy
[root@mylnx01 ~]# fuser -m /u02-old
/u02-old: 5205c
[root@mylnx01 ~]# ps -ef | grep 5205
root 5205 5201 0 May09 pts/1 00:00:00 bash
root 24930 24687 0 08:13 pts/2 00:00:00 grep 5205
[root@mylnx01 ~]# kill -9 5205
[root@mylnx01 ~]# umount /u02-old
[root@mylnx01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
37G 21G 15G 60% /
/dev/sda1 99M 23M 71M 25% /boot
tmpfs 7.9G 0 7.9G 0% /dev/shm
/dev/mapper/VolGroup02-LogVol20
60G 37G 20G 66% /u03
/dev/mapper/VolGroup03-LogVol30
60G 36G 21G 64% /u04
/dev/mapper/VolGroup04-LogVol40
148G 54G 88G 38% /u02
[root@mylnx01 ~]#
步骤2:新建或重命名挂载点目录
[root@mylnx01 u02-old]# cd ..
[root@mylnx01 /]# mv /u02-old/ /u05
步骤3:重新挂载设备到挂载点或目录
[root@mylnx01 u05]# mount /dev/VolGroup01/LogVol10 /u05
[root@mylnx01 u05]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
37G 21G 15G 60% /
/dev/sda1 99M 23M 71M 25% /boot
tmpfs 7.9G 0 7.9G 0% /dev/shm
/dev/mapper/VolGroup02-LogVol20
60G 37G 20G 66% /u03
/dev/mapper/VolGroup03-LogVol30
60G 36G 21G 64% /u04
/dev/mapper/VolGroup04-LogVol40
148G 54G 88G 38% /u02
/dev/mapper/VolGroup01-LogVol10
60G 54G 3.0G 95% /u05
步骤4:编辑/etc/fastab配置信息。
[root@mylnx01 /]# vi /etc/fstab
/dev/VolGroup00/LogVol00 / 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
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
/dev/VolGroup02/LogVol20 /u03 ext3 defaults 1 2
/dev/VolGroup03/LogVol30 /u04 ext3 defaults 1 2
/dev/VolGroup04/LogVol40 /u02 ext3 defaults 1 2
/dev/VolGroup01/LogVol10 /u02-old ext3 defaults 1 2
时间: 2024-11-18 19:02:11