Linux operating system partitioning tool Fdisk tool introduction

  
 

The fdisk function under Linux is extremely powerful. It can be used to divide the most complicated partition. Here is a brief introduction to its usage: For IDE hard disks, each disk has a device name: four IDEs corresponding to the motherboard. Interface, device name is: /dev/hda, /dev/hdb, /dev/hdc, /dev/hdd, etc. If there is an IDE Raid card, then: /dev/hde, /dev/hdf, /Dev/hdg, /dev/hdh. For SCSI hard disks, the device name is /dev/sda, /dev/sdb...etc. The command line usage of fdisk is: fdisk After the hard disk device name enters fdisk, first type 'm' to display all the fdisk menus. . Type 'p' again to display the current partition table status. Type 'n' to add a partition and then prompt you to select the partition type (basic partition or extended partition) and then select the partition number (1-4). Note: Each hard disk can be divided into up to four primary partitions (including basic partitions and extended partitions). Among them, the basic partition can be divided into up to four, and the extended partition can be divided into at most one, but multiple logical partitions can be divided in the extended partition ( I have not tried at most a few, in short, a lot). After selecting the partition type and partition number you want to create, you will be prompted to enter the starting cylinder, starting from 1; then enter the ending cylinder, you can enter the actual number of cylinders, you can also use "+partition size" The way to input, such as: +1024M means add 1024M after the starting cylinder. The device names of the primary partition are: /dev/hda1, /dev/hda2, /dev/hda3, /dev/hda4, and the device names of the logical partitions are: /dev/hda5, /dev/hda6, /dev/hda7 ...and many more. Type & rsquo;d‘, delete the partition, enter the partition number to delete. Note that when you delete an extended partition, all logical partitions are also deleted. Type & rsquo;t‘, change the partition flag (this is the most essential part of Linux fdisk!), the new partition default flag is 83 (Linux Ext2), you can change it to 82 (Linux swap area), or 'b' (FAT32), 'f' (FAT32 Extend, extended partition only), '86' (NTFS). . . Wait for dozens of types. In this way, friends who use the operating system
can use Linux fdisk to divide all the partitions you want! Type 'a' to switch the partition activation switch. Please note: Each time you type, the selected partition will change between active and inactive, but you must ensure that only one partition is activated at the end. At this point, you will get the 'p' command. There will be a '*' on the activated partition. In addition to the above commands, there are several other, but less common. Finally, type ’w', the changes you made to the partition are written to the hard disk; type 'q' to discard all modifications. Flexible application of fdisk can also repair some damaged partition tables, provided that you must accurately remember the starting and ending cylinders of each original partition. Then add a way to format the hard disk: format the partition into Linux Ext2 format, use: mkext2fs /dev/hda? To format the partition into FAT32 format, use: mkfs.vfat /dev/hda?/sbin/mkfs .ext3 /dev/sda2mkdir /dataModify /etc/fstab Restart the computer as follows /dev/sda2 /data ext3 defaults 1 1

Copyright © Windows knowledge All Rights Reserved