脚本create_swap.sh
来源:互联网 发布:最小的windows 编辑:程序博客网 时间:2024/06/09 23:23
编写脚本 creat_swap.sh 要求:
**执行脚本后系统会自动建立新swap
**这个自动建立的swap分区需要开机自动激活
[root@localhost ~]# vim /bin/create_swap.sh
[root@localhost ~]# chmod +x /bin/create_swap.sh ###加可执行权限
测试:
[root@localhost ~]# create_swap.sh /dev/vdb p +100M
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): Partition number (1-4, default 1): First sector (2048-20971519, default 2048): Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519): Partition 1 of type Linux and of size 100 MiB is set
Command (m for help): Selected partition 1
Hex code (type L to list all codes): Changed type of partition 'Linux' to 'Linux swap / Solaris'
Command (m for help): The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
- create_swap.sh脚本
- 脚本create_swap.sh
- 编写脚本create_swap.sh
- create_swap.sh脚本的编写
- create_swap.sh
- 第一个sh脚本
- sh脚本使用整理
- sh 脚本格式
- orainstroot.sh 脚本
- sh脚本编码问题
- runcluvfy.sh 脚本使用
- sh脚本 语法
- 创建.sh脚本
- install_zj.sh脚本优化
- .sh脚本的相关内容
- linux crond 脚本.sh
- sh脚本语法
- .sh脚本语法
- ERROR ITMS-90023: "Missing required icon file.
- ftp文件共享服务
- 基于 Django1.10 文档的深入学习(20)—— Using the Django authentication system 之 login()
- 嵌入式应用编程经验之谈-局部变量造成的死机
- NGINX配置
- 脚本create_swap.sh
- Linux if判断字符串是否相等
- selinux对文件的控制
- 使用PYTHON POPLIB模块实现邮件收取
- iOS学习笔记-- tableView单选的实现
- 忘记密码zabbix
- 小米手机调试总出现“INSTALL_CANCELED_BY_USER”
- 文件描述符fd与文件指针FILE*的关系
- C++外观模式