挂载与卸载磁盘分区

昨天装了一个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: [email protected]
#
# 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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值