磁盘分区的删除
来源:互联网 发布:淘宝有试衣功能吗 编辑:程序博客网 时间:2024/05/03 17:59
使用fdisk 设备名 进入fdisk 界面。
[root@zeng ~]# fdisk /dev/sdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
//先来查看下该设备的分区表,这是在执行其他操作前的好习惯。
Command (m for help): p
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd7ea6b16
Device Boot Start End Blocks Id System
/dev/sdb1 1 1044 8385898+ 5 Extended
/dev/sdb5 1 1044 8385867 83 Linux
//有两个分区,一个扩展分区/dev/sdb1,还有一个逻辑分区/dev/sda5。
使用d 来删除分区.
Command (m for help): d
Partition number (1-5): 5 //输入要删除的分区好5即代表/dev/sdb5.
Command (m for help): p
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd7ea6b16
Device Boot Start End Blocks Id System
// /dev/sdb1 1 1044 8385898+ 5 Extended
逻辑分区/dev/sdb5 已经被删除了,现在我们再来把扩展分区也给删除掉.
Command (m for help): d
Selected partition 1
因为只剩下最后一个分区,所以fdisk 自动的选中该分区.
Command (m for help): p
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd7ea6b16
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.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks
在执行分区删除的时候出现了一个错误,说的是系统无法加载信息的分区表,因为设备在忙。因为
我粗心大意在删除分区前,没有把该分区卸载掉。下面来补做这个工作。
[root@zeng ~]# umount /dev/sdb5
查看下设备的分区表,ok 没问题.
[root@zeng ~]# fdisk /dev/sdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): p
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd7ea6b16
Device Boot Start End Blocks Id System
Command (m for help): q
- 磁盘分区的删除
- freebsd删除现有的磁盘分区
- linux创建删除磁盘分区
- CentOS磁盘分区添加删除
- CentOS磁盘分区添加删除
- 如何合并/删除磁盘分区
- ASM磁盘分区或者设备文件删除后恢复的方法
- Linux磁盘分区(二):删除
- windows的磁盘操作之三——获取和删除磁盘分区信息
- windows的磁盘操作之三——获取和删除磁盘分区信息
- windows的磁盘操作之三——获取和删除磁盘分区信息
- windows的磁盘操作之三——获取和删除磁盘分区信息
- Linux的磁盘分区
- Linux下的磁盘分区
- Linux的磁盘分区
- linux的磁盘分区
- ubuntu下的磁盘分区
- 传统磁盘分区的理解
- 信息资源管理 第二章
- 4----8
- linux下磁盘分区与格式化
- 胸大肌锻炼方法大全
- 最实用DOS命令参数的中文详解
- 磁盘分区的删除
- JSP内置对象(2)----out、application
- 在Eclipse下搭建Android开发环境教程
- 第七周作业任务一
- 2.创建基本应用程序模板
- 每天一到算法题--重叠区间大小
- Android SDK安装失败的解决方法
- C++多核高级编程 - 01 新的计算机体系结构及多核设计
- 第七周 任务1