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 -lDisk /dev/sda: 53.6 GB, 53687091200 bytes 255 heads, 63 sectors/track, 6527 cylinders Units = cylinders of 16065 * 512 = 8225280 bytesDevice 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 LinuxDisk /dev/sdb: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytesDevice 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/sdbThe 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 actiona toggle a bootable flagb edit bsd disklabelc toggle the dos compatibility flagd delete a partitionl list known partition typesm print this menun add a new partitiono create a new empty DOS partition tablep print the partition tableq quit without saving changess create a new empty Sun disklabelt change a partition's system idu change display/entry unitsv verify the partition tablew write table to disk and exitx extra functionality (experts only)Command (m for help): pDisk /dev/sdb: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytesDevice 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 bytesDevice 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): 2Command (m for help): d Partition number (1-7): 3Command (m for help): d Partition number (1-7): 4Command (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 bytesDevice Boot Start End Blocks Id SystemCommand (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)指明,不勝感激。
*****************************************************************************************************
轉載于:https://www.cnblogs.com/lxjshuju/p/6869473.html
總結
以上是生活随笔為你收集整理的Linux磁盘分区(二):删除的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 有线节点与无线节点的混合仿真模拟实验
- 下一篇: 文字放大缩小