昨天装了一个XFCE桌面环境,感觉不错,不过,有点不方便之处,就是在XFCE窗口管理下竟然看不到其他没有挂载的分区图标,无法在GUI下直接点击挂载;在GNOME下反而很容易挂载,在Ubuntu下甚至不用输入管理员密码。
为了方便以后挂载与卸载其他没有挂载的分区,只好自己动手写一个shell脚本了。
以下是挂载与卸载分区的脚本。这是我的情况,如果你也想用的话,可能要修改一下。下面的脚本没有做任何信息隐藏,可以会暴露我的计算机里面的一些信息,不过没关系;如果我的计算机真的因为这被入侵或信息泄露,那说明我现在是技不如人!呵呵......
为了使这些脚本即使在纯终端下也能正常运行并不会出现乱码现象,在脚本中全部使用了ASCII中的英文字符进行书写,尽管注释不会被执行,为了保持一致,连同注释一并使用英文。由于本人英文水平有限,可能某些地方表述的不是太准确,望见谅!
一、挂载
#! /bin/bash
#
# SCRIPT: mpart --------mount the partition
# AUTHOR: xgfone
# DATE: 10/12 2011
# REV: 0.1.P (Valid are A, B, D, T, Q, and P)
# (For Alpha, Beta, Dev, Test, QA, and Production)
#
# PLATFORM: Linux. Other platform don't be tested!
# (SPECIFY: AIX, HP-UX, Linux, OpenBSD, Solaris, other flavor,
# or Not platform dependent)
#
# REQUIREMENTS: the commands of using in this script: mount, mkdir
#
# PURPOSE: Batch mount the partition which don't be mounted when the
# system has been started.
#
# NOTE: this scrip has nine directiories, which can mount nine
# partitions. If you has less than nine partitions, you can only
# assign what you demand to the directory variable which express
# the name of some of nine partitions; and comment the others.
# But if the number of your partitions to mount is more than
# nine, you need create the new directiory variable, and add the
# correspondent statements to the correspondent positions.
# Just in one word: ACCORDING TO YOUR REQUESTS!
#
# EMAIL: xgfone@126.com
#
# REV LIST:
# DATE: 10/12 2011
# BY: xgfone
# MODIFICATION: first create!
#
# set -n # Uncomment to check script syntax, without execution.
# # NOTE: Do not forget to put the # comment back in or
# # the shell script will never execute!
# set -x # Uncomment to debug this shell script
#
################################################################################
# COPYRIGHT
################################################################################
# mpart --------mount the partitions
# Copyright (C) 2011 xgfone
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it
为了方便以后挂载与卸载其他没有挂载的分区,只好自己动手写一个shell脚本了。
以下是挂载与卸载分区的脚本。这是我的情况,如果你也想用的话,可能要修改一下。下面的脚本没有做任何信息隐藏,可以会暴露我的计算机里面的一些信息,不过没关系;如果我的计算机真的因为这被入侵或信息泄露,那说明我现在是技不如人!呵呵......
为了使这些脚本即使在纯终端下也能正常运行并不会出现乱码现象,在脚本中全部使用了ASCII中的英文字符进行书写,尽管注释不会被执行,为了保持一致,连同注释一并使用英文。由于本人英文水平有限,可能某些地方表述的不是太准确,望见谅!
一、挂载
#! /bin/bash
#
# SCRIPT: mpart --------mount the partition
# AUTHOR: xgfone
# DATE: 10/12 2011
# REV: 0.1.P (Valid are A, B, D, T, Q, and P)
# (For Alpha, Beta, Dev, Test, QA, and Production)
#
# PLATFORM: Linux. Other platform don't be tested!
# (SPECIFY: AIX, HP-UX, Linux, OpenBSD, Solaris, other flavor,
# or Not platform dependent)
#
# REQUIREMENTS: the commands of using in this script: mount, mkdir
#
# PURPOSE: Batch mount the partition which don't be mounted when the
# system has been started.
#
# NOTE: this scrip has nine directiories, which can mount nine
# partitions. If you has less than nine partitions, you can only
# assign what you demand to the directory variable which express
# the name of some of nine partitions; and comment the others.
# But if the number of your partitions to mount is more than
# nine, you need create the new directiory variable, and add the
# correspondent statements to the correspondent positions.
# Just in one word: ACCORDING TO YOUR REQUESTS!
#
# EMAIL: xgfone@126.com
#
# REV LIST:
# DATE: 10/12 2011
# BY: xgfone
# MODIFICATION: first create!
#
# set -n # Uncomment to check script syntax, without execution.
# # NOTE: Do not forget to put the # comment back in or
# # the shell script will never execute!
# set -x # Uncomment to debug this shell script
#
################################################################################
# COPYRIGHT
################################################################################
# mpart --------mount the partitions
# Copyright (C) 2011 xgfone
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it