***********************************************声明************************************************

原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明出处(http://blog.csdn.net/huangyanlong)。

表述有错误之处,请您留言或邮件(hyldba@163.com)指明,不胜感激。

*****************************************************************************************************

续接上篇:“举例:将sdb1格式化为ext3文件系统”点击打开链接

*****************************************************************************************************

Linux硬盘分区(二):删除

*****************************************************************************************************

*************************

举例:对sdb1进行umount

*************************

  1. [root@hyl /]# df -h
  2. Filesystem            Size  Used Avail Use% Mounted on
  3. /dev/sda1             9.7G  5.4G  3.9G  59% /
  4. /dev/sda3              35G   17G   17G  50% /home
  5. tmpfs                1006M     0 1006M   0% /dev/shm
  6. /dev/sdb1             1.9G   35M  1.8G   2% /data1
  7. [root@hyl /]# umount /data1
  8. [root@hyl /]# df -h
  9. Filesystem            Size  Used Avail Use% Mounted on
  10. /dev/sda1             9.7G  5.4G  3.9G  59% /
  11. /dev/sda3              35G   17G   17G  50% /home
  12. tmpfs                1006M     0 1006M   0% /dev/shm
  13. [root@hyl /]# fdisk -l
  14. Disk /dev/sda: 53.6 GB, 53687091200 bytes
  15. 255 heads, 63 sectors/track, 6527 cylinders
  16. Units = cylinders of 16065 * 512 = 8225280 bytes
  17. Device Boot      Start         End      Blocks   Id  System
  18. /dev/sda1   *           1        1305    10482381   83  Linux
  19. /dev/sda2            1306        1827     4192965   82  Linux swap / Solaris
  20. /dev/sda3            1828        6527    37752750   83  Linux
  21. Disk /dev/sdb: 10.7 GB, 10737418240 bytes
  22. 255 heads, 63 sectors/track, 1305 cylinders
  23. Units = cylinders of 16065 * 512 = 8225280 bytes
  24. Device Boot      Start         End      Blocks   Id  System
  25. /dev/sdb1               1         250     2008093+  83  Linux
  26. /dev/sdb2             251         500     2008125   83  Linux
  27. /dev/sdb3             501         750     2008125   83  Linux
  28. /dev/sdb4             751        1305     4458037+   5  Extended
  29. /dev/sdb5             751         875     1004031   83  Linux
  30. /dev/sdb6             876        1000     1004031   83  Linux
  31. /dev/sdb7            1001        1305     2449881   83  Linux

*************************

对第二块磁盘操作(即/dev/sdb)

*************************

  1. [root@hyl /]# fdisk /dev/sdb
  2. The number of cylinders for this disk is set to 1305.
  3. There is nothing wrong with that, but this is larger than 1024,
  4. and could in certain setups cause problems with:
  5. 1) software that runs at boot time (e.g., old versions of LILO)
  6. 2) booting and partitioning software from other OSs
  7. (e.g., DOS FDISK, OS/2 FDISK)
  8. Command (m for help): m
  9. Command action
  10. a   toggle a bootable flag
  11. b   edit bsd disklabel
  12. c   toggle the dos compatibility flag
  13. d   delete a partition
  14. l   list known partition types
  15. m   print this menu
  16. n   add a new partition
  17. o   create a new empty DOS partition table
  18. p   print the partition table
  19. q   quit without saving changes
  20. s   create a new empty Sun disklabel
  21. t   change a partition's system id
  22. u   change display/entry units
  23. v   verify the partition table
  24. w   write table to disk and exit
  25. x   extra functionality (experts only)
  26. Command (m for help): p
  27. Disk /dev/sdb: 10.7 GB, 10737418240 bytes
  28. 255 heads, 63 sectors/track, 1305 cylinders
  29. Units = cylinders of 16065 * 512 = 8225280 bytes
  30. Device Boot      Start         End      Blocks   Id  System
  31. /dev/sdb1               1         250     2008093+  83  Linux
  32. /dev/sdb2             251         500     2008125   83  Linux
  33. /dev/sdb3             501         750     2008125   83  Linux
  34. /dev/sdb4             751        1305     4458037+   5  Extended
  35. /dev/sdb5             751         875     1004031   83  Linux
  36. /dev/sdb6             876        1000     1004031   83  Linux
  37. /dev/sdb7            1001        1305     2449881   83  Linux
  38. </span>

*************************

删除分区:sdb1及其它

*************************

  1. Command (m for help): d
  2. --输入删除指令
  3. Partition number (1-7): 1
  4. --输入删除的分区号
  5. Command (m for help): p
  6. --打印分区表
  7. Disk /dev/sdb: 10.7 GB, 10737418240 bytes
  8. 255 heads, 63 sectors/track, 1305 cylinders
  9. Units = cylinders of 16065 * 512 = 8225280 bytes
  10. Device Boot      Start         End      Blocks   Id  System
  11. /dev/sdb2             251         500     2008125   83  Linux
  12. /dev/sdb3             501         750     2008125   83  Linux
  13. /dev/sdb4             751        1305     4458037+   5  Extended
  14. /dev/sdb5             751         875     1004031   83  Linux
  15. /dev/sdb6             876        1000     1004031   83  Linux
  16. /dev/sdb7            1001        1305     2449881   83  Linux
  17. --可以看到sdb1已经被删除了
  18. --接下来同理,删除其它分区
  19. Command (m for help): d
  20. Partition number (1-7): 2
  21. Command (m for help): d
  22. Partition number (1-7): 3
  23. Command (m for help): d
  24. Partition number (1-7): 4
  25. Command (m for help): p
  26. Disk /dev/sdb: 10.7 GB, 10737418240 bytes
  27. 255 heads, 63 sectors/track, 1305 cylinders
  28. Units = cylinders of 16065 * 512 = 8225280 bytes
  29. Device Boot      Start         End      Blocks   Id  System
  30. Command (m for help): w
  31. --保存退出
  32. The partition table has been altered!
  33. Calling ioctl() to re-read partition table.
  34. Syncing disks.
  35. --现在可以移除磁盘了

***********************************************声明************************************************

原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明出处(http://blog.csdn.net/huangyanlong)。

表述有错误之处,请您留言或邮件(hyldba@163.com)指明,不胜感激。

*****************************************************************************************************

Linux磁盘分区(二):删除的更多相关文章

  1. Linux磁盘分区(二)之挂载卸载常用命令

    Linux磁盘分区(二)之挂载卸载常用命令 转自:https://blog.csdn.net/qq_36183935/article/details/81053383           https: ...

  2. 调整Linux磁盘分区的大小的方法

      昨天数据入库时,一直报错,说磁盘满了,,df -h    一看,发现/目录下只有50G空间,已使用49G:我的程序和dbss都安装在/目录下,ftp到的数据放在/data下的一个子目录下,分解完的 ...

  3. Linux磁盘分区与格式化

    磁盘分区格式说明 linux分区不同于windows linux下分区标示: 例如:hda1 hd这两个字母表示分区所在的设备类型,hd标示IDE类型硬盘,sd表示SCSI类型硬盘 第三字母a标示硬盘 ...

  4. Linux fdisk命令参数及用法详解---Linux磁盘分区管理命令fdisk

    fdisk 命令 linux磁盘分区管理 用途:观察硬盘之实体使用情形与分割硬盘用. 使用方法: 一.在 console 上输入 fdisk -l /dev/sda ,观察硬盘之实体使用情形. 二.在 ...

  5. linux磁盘 分区 物理卷 卷组 逻辑卷 文件系统加载点操作案例

    转自:truemylife.linux磁盘 分区 物理卷 卷组 逻辑卷 文件系统加载点操作案例 基本概念: 磁盘.分区.物理卷[物理部分] 卷组[中间部分] 逻辑卷.文件系统[虚拟化后可控制部分] 磁 ...

  6. Linux crond任务调度(定时任务),Linux磁盘分区/挂载

    一.crond任务调度 1.基本语法 crontab [选项] -e : 编辑 crontab定时任务 -l : 查询crontab -r : 删除当前用户所有的crontab任务 例子: 每分钟执行 ...

  7. Linux磁盘分区(四)之分区大小调整

    Linux磁盘分区(四)之分区大小调整在学习调整分区大小之前,先了解linx分区的概念.参考如下博客:[1]linux 分区 物理卷 逻辑卷 https://www.cnblogs.com/liuch ...

  8. Linux磁盘分区(一)之fdisk命令

    Linux磁盘分区(一)之fdisk命令转自:https://www.cnblogs.com/machangwei-8/p/10353683.html 一.fdisk 的介绍fdsik 能划分磁盘成为 ...

  9. linux磁盘分区模式

    linux磁盘分区模式 模式一:MBR 1)主分区不超过四个 2)单个分区容量最大2TB 模式二:GPT 1)主分区个数"几乎"没有限制(原因:在GPT的分区表中最多可以支持128 ...

  10. <实训|第七天>横扫Linux磁盘分区、软件安装障碍附制作软件仓库

    期待已久的linux运维.oracle"培训班"终于开班了,我从已经开始长期四个半月的linux运维.oracle培训,每天白天我会好好学习,晚上回来我会努力更新教程,包括今天学到 ...

随机推荐

  1. 别指望一文读懂Java并发之从一个线程开始

    Understanding concurrent programming is on the same order of difficulty as understanding object-orie ...

  2. C++编译程序时的内存分配

    一个由C/C++编译的程序占用的内存分为以下几个部分 1.栈区(stack)— 程序运行时由编译器自动分配,存放函数的参数值,局部变量的值等.其操作方式类似于数据结构中的栈.程序结束时由编译器自动释放 ...

  3. 解决Qt编译动态链接库could not find or load the Qt platform plugin "windows" in.问题

    最近用Qt5做了一个项目的界面,在编译成可执行文件EXE之后,运行文件,提示: This application failed to start because it could not find o ...

  4. java注解(Annotation)

    本文转载自http://www.cnblogs.com/xdp-gacl/p/3622275.html 一.认识注解 注解(Annotation)很重要,未来的开发模式都是基于注解的,JPA是基于注解 ...

  5. Linux网络中接收 "二进制" 流的那些事 --- 就recv的返回值和strlen库函数进行对话

    1.    前言 很多朋友在做网络编程开发的时候可能都遇到这样的问题,在进行接收二进制流的数据的时候,使用strlen库函数来得到 二进制数据长度的时候并不准确.为什么呢??首先,使用strlen进行 ...

  6. day4--老Word模板使用指南

    Word常用快捷键 Ctrl + 1 一级标题 Ctrl + 2 二级标题 Ctrl + 3 三级标题 Ctrl + 5 代码块输入 Ctrl + 6 正文输入 专业的排版,一定要规范,目录,生成目录

  7. Python中的切片符

    最近在学python,感觉切片符有点难以理解.在网上查了点资料,然后做个总结 理解切片符,首先得知道数组是从0开始的, 而且切片符最后一个是-1. 我们先定义个数组   a=[1,2,3,4,5] 切 ...

  8. params修饰符

    http://msdn.microsoft.com/zh-cn/library/w5zay9db.aspx params 关键字可以指定采用数目可变的参数的方法参数. 可以发送参数声明中所指定类型的逗 ...

  9. .net core 在视图中快速获取路由(Areas、Controller、Action)

    我们在.net core中,经常碰到需要获取当前的Areas.Controller.Action,于是小编就扩展了Html,这样即可使用 Html.***来获取这些信息. 具体扩展类如下: publi ...

  10. [转载] Linux的Top命令解析

    转载自http://www.jb51.net/LINUXjishu/34604.html.http://blog.csdn.net/hello_yang213/article/details/7455 ...