Linux磁盘分区(二):删除
***********************************************声明************************************************
原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明出处(http://blog.csdn.net/huangyanlong)。
表述有错误之处,请您留言或邮件(hyldba@163.com)指明,不胜感激。
*****************************************************************************************************
续接上篇:“举例:将sdb1格式化为ext3文件系统”点击打开链接
*****************************************************************************************************
Linux硬盘分区(二):删除
*****************************************************************************************************
*************************
举例:对sdb1进行umount
*************************
- [root@hyl /]# df -h
- Filesystem Size Used Avail Use% Mounted on
- /dev/sda1 9.7G 5.4G 3.9G 59% /
- /dev/sda3 35G 17G 17G 50% /home
- tmpfs 1006M 0 1006M 0% /dev/shm
- /dev/sdb1 1.9G 35M 1.8G 2% /data1
- [root@hyl /]# umount /data1
- [root@hyl /]# df -h
- Filesystem Size Used Avail Use% Mounted on
- /dev/sda1 9.7G 5.4G 3.9G 59% /
- /dev/sda3 35G 17G 17G 50% /home
- tmpfs 1006M 0 1006M 0% /dev/shm
- [root@hyl /]# fdisk -l
- Disk /dev/sda: 53.6 GB, 53687091200 bytes
- 255 heads, 63 sectors/track, 6527 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Device Boot Start End Blocks Id System
- /dev/sda1 * 1 1305 10482381 83 Linux
- /dev/sda2 1306 1827 4192965 82 Linux swap / Solaris
- /dev/sda3 1828 6527 37752750 83 Linux
- Disk /dev/sdb: 10.7 GB, 10737418240 bytes
- 255 heads, 63 sectors/track, 1305 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Device Boot Start End Blocks Id System
- /dev/sdb1 1 250 2008093+ 83 Linux
- /dev/sdb2 251 500 2008125 83 Linux
- /dev/sdb3 501 750 2008125 83 Linux
- /dev/sdb4 751 1305 4458037+ 5 Extended
- /dev/sdb5 751 875 1004031 83 Linux
- /dev/sdb6 876 1000 1004031 83 Linux
- /dev/sdb7 1001 1305 2449881 83 Linux
*************************
对第二块磁盘操作(即/dev/sdb)
*************************
- [root@hyl /]# fdisk /dev/sdb
- The number of cylinders for this disk is set to 1305.
- There is nothing wrong with that, but this is larger than 1024,
- and could in certain setups cause problems with:
- 1) software that runs at boot time (e.g., old versions of LILO)
- 2) booting and partitioning software from other OSs
- (e.g., DOS FDISK, OS/2 FDISK)
- Command (m for help): m
- Command action
- a toggle a bootable flag
- b edit bsd disklabel
- c toggle the dos compatibility flag
- d delete a partition
- l list known partition types
- m print this menu
- n add a new partition
- o create a new empty DOS partition table
- p print the partition table
- q quit without saving changes
- s create a new empty Sun disklabel
- t change a partition's system id
- u change display/entry units
- v verify the partition table
- w write table to disk and exit
- x extra functionality (experts only)
- Command (m for help): p
- Disk /dev/sdb: 10.7 GB, 10737418240 bytes
- 255 heads, 63 sectors/track, 1305 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Device Boot Start End Blocks Id System
- /dev/sdb1 1 250 2008093+ 83 Linux
- /dev/sdb2 251 500 2008125 83 Linux
- /dev/sdb3 501 750 2008125 83 Linux
- /dev/sdb4 751 1305 4458037+ 5 Extended
- /dev/sdb5 751 875 1004031 83 Linux
- /dev/sdb6 876 1000 1004031 83 Linux
- /dev/sdb7 1001 1305 2449881 83 Linux
- </span>
*************************
删除分区:sdb1及其它
*************************
- Command (m for help): d
- --输入删除指令
- Partition number (1-7): 1
- --输入删除的分区号
- Command (m for help): p
- --打印分区表
- Disk /dev/sdb: 10.7 GB, 10737418240 bytes
- 255 heads, 63 sectors/track, 1305 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Device Boot Start End Blocks Id System
- /dev/sdb2 251 500 2008125 83 Linux
- /dev/sdb3 501 750 2008125 83 Linux
- /dev/sdb4 751 1305 4458037+ 5 Extended
- /dev/sdb5 751 875 1004031 83 Linux
- /dev/sdb6 876 1000 1004031 83 Linux
- /dev/sdb7 1001 1305 2449881 83 Linux
- --可以看到sdb1已经被删除了
- --接下来同理,删除其它分区
- Command (m for help): d
- Partition number (1-7): 2
- Command (m for help): d
- Partition number (1-7): 3
- Command (m for help): d
- Partition number (1-7): 4
- Command (m for help): p
- Disk /dev/sdb: 10.7 GB, 10737418240 bytes
- 255 heads, 63 sectors/track, 1305 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Device Boot Start End Blocks Id System
- Command (m for help): w
- --保存退出
- The partition table has been altered!
- Calling ioctl() to re-read partition table.
- Syncing disks.
- --现在可以移除磁盘了
***********************************************声明************************************************
原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明出处(http://blog.csdn.net/huangyanlong)。
表述有错误之处,请您留言或邮件(hyldba@163.com)指明,不胜感激。
*****************************************************************************************************
相关文章
- linux 删除开头是减号的文件名
- linux系统中删除文件夹
- Linux 上部署 Seafile 9.0.x 专业版(Seafile Server端)——踩一路坑,溅一身水
- Linux中显示系统中USB信息的lsusb命令
- userdel 命令 - 从Linux系统中删除用户账户
- 使用6款卓尔不群的Linux操作系统为你的上网本添活力
- 如何在Linux上将HTML页面转化成png图片
- 如何在 Linux 中使用 Alpine 在命令行里访问 Gmail
- Linux 新手必知必会的 10 条 Linux 基本命令
- Linux系统配置ssh监听多个端口方法
- Linux(CentOS 7)下安装Composer
- linux如何设置环境变量
- Linux(CentOS7)系统中部署Django web框架
- 【Linux】Ubuntu系统下用apt命令删除/卸载软件包
- 用navicat访问linux数据库,成功实现Navicat访问Linux中安装的MySQL数据库
- Linux之特殊的环境变量IFS以及如何删除带有空格的目录
- Linux(centos)新建,删除,移动,重命名文件夹和文件的命令
- Linux命令行批量删除文件(目录)
- Linux下SVN安装配置以及使用
- linux用户,组管理总结(8/19)
- linux关于防火墙的一些知识
- Linux sed命令
- 定时备份mysql数据库 并删除7天前的备份 (windows linux )
- Linux学习笔记(11)linux网络管理与配置之一——配置路由与默认网关,双网卡绑定(5-6)
- Linux学习笔记(3)linux服务管理与启停(开机自启与自定义服务)
- 学习Linux二(创建、删除文件和文件夹命令)
- 每天一个linux命令(14):which命令
- Linux下matalb2021a和2022a无法启动simulink的解决方案之一