Linux disk partition (2): Delete
**************************************** ******************************** ****************
Original works, from "Deep Blue blog" blog, welcome to reprint, reprint please be sure to indicate the source (http://blog.csdn.net/huangyanlong ).
Please leave a message or email (hyldba@163.com) indicating that there is an error. Thank you very much.
****************************************************************** ***********************************
Next article: "Example: Format sdb1 as ext3 File System" click to open the link
**************************************** **************************************** *********************
Linux hard disk partition (2): Delete
**************************************** **************************************** *********************
*************************
Example: umount sdb1
*************************
[root@hyl /]# df -hFilesystem Size Used Avail Use% Mounted on/dev/sda1 9.7G 5.4G 3.9G 59% //dev/sda3 35G 17G 17G 50% /hometmpfs 1006M 0 1006M 0% /dev/shm/dev/sdb1 1.9G 35M 1.8G 2% /data1[root@hyl /]# umount /data1[root@hyl /]# df -hFilesystem Size Used Avail Use% Mounted on/dev/sda1 9.7G 5.4G 3.9G 59% //dev/sda3 35G 17G 17G 50% /hometmpfs 1006M 0 1006M 0% /dev/shm[root@hyl /]# fdisk -lDisk /dev/sda: 53.6 GB, 53687091200 bytes255 heads, 63 sectors/track, 6527 cylindersUnits = 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 LinuxDisk /dev/sdb: 10.7 GB, 10737418240 bytes255 heads, 63 sectors/track, 1305 cylindersUnits = 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
*************************
Operation on the second disk (I .e./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): mCommand 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): pDisk /dev/sdb: 10.7 GB, 10737418240 bytes255 heads, 63 sectors/track, 1305 cylindersUnits = 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>
*************************
Delete partitions: sdb1 and others
*************************
Command (m for help): d -- enter the DELETE Command Partition number (1-7): 1 -- enter the deleted Partition number Command (m for help ): p -- print Partition Table Disk/dev/sdb: 10.7 GB, 10737418240 bytes255 heads, 63 sectors/track, 1305 cylindersUnits = 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 83 Linux/dev/sdb6 876 1000 1004031 83 Linux/dev/sdb7 1001 1305 2449881 83 Linux -- we can see that sdb1 has been deleted -- Similarly, delete other partitions Command (m for help): dPartition number (1-7): 2 Command (m for help): dPartition number (1-7): 3 Command (m for help): dPartition number (1-7): 4 Command (m for help): p Disk/dev/sdb: 10.7 GB, 10737418240 bytes255 heads, 63 sectors/track, 1305 cylindersUnits = cylinders of 16065*512 = 822528 0 bytes Device Boot Start End Blocks Id SystemCommand (m for help): w -- save and quit The partition table has been altered! Calling ioctl () to re-read partition table. Syncing disks. -- Now you can remove the disk.
**************************************** ******************************** ****************
Original works, from "Deep Blue blog" blog, welcome to reprint, reprint please be sure to indicate the source (http://blog.csdn.net/huangyanlong ).
Please leave a message or email (hyldba@163.com) indicating that there is an error. Thank you very much.
****************************************************************** ***********************************