FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Introduction to FDISK Command in Linux

     

    "1. Command introduction The fdisk command is used to create and maintain a disk partition table. It adopts the traditional question and answer interface instead of the interactive operation interface similar to cfdisk of fdisk, so it is inconvenient to use, but the function is not discounted at all. It is compatible with DOS type partition table, BSD or sun type disk list. 2. Command format fdisk [-uc] [-b sectorsize] [-C cyls] [-H heads] [-S sects] device fdisk -l [-u] [device.。.] fdisk -s partition.。. fdisk -v fdisk -h 3. Description of options -B [sectorsize]: Specifies the sector size of the hard disk. The available values are 51210242048 or 4096; -c: Turn off DOS compatibility mode; -C [cyls]: Specifies the number of cylinders of the hard disk; -H [heads]: Specifies the number of heads of the hard disk. Of course, it is not a physical value, but acts on the partition table. The reasonable values are 255 and 16; -S [sectors]: Specifies the number of sectors of each track. Of course, it is not a physical value, but is used in the partition table. A reasonable value is 63; -l: List the partition table for the specified device, and then exit. If no devices are given, use those mentioned in / proc / partitions (if any); -u: When the partition table is listed, the sector size is given instead of the cylinder size; -S [partition]: displays the size of the specified partition in block; -v: Display version information; -h: Displays help information. After reading the above options, you should pay attention to the following questions: (1) The difference between a block and a sector. Sector is the smallest storage unit for hard disk, and block is the smallest access unit for file system. Generally speaking, a sector size is 512b, a block size is 4KB, and a block is composed of 8 consecutive sectors. (2) To understand the meaning of the above options, you need to understand the physical composition and related concepts of the disk, such as the specific meaning of the components such as sector, cylinder and head. See the storage principle and internal architecture of the hard disk. 4. Common examples (1) Lists the zoning of the specified device. [ root@add_ friend_ protect /home/oicq]# fdisk -l /dev/sda Disk /dev/sda: 300.0 GB, 299966445568 bytes 255 heads, 63 sectors/track, 36468 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes Disk identifier: 0x0009808c Device Boot Start End Blocks Id System /dev/sda1 * 1 1306 10485760 83 Linux /dev/sda2 1306 1566 2088960 82 Linux swap / Solaris /dev/sda3 1566 4177 20971520 83 Linux /dev/sda4 4177 36469 259387694 83 Linux The fdisk - L values are explained as follows: The first line indicates that the total size of the hard disk / dev / SDA is 300.0 GB; In the second line, heads indicates the number of hard disk heads, which is also the number of disk faces, because the number of heads is equal to the number of disk faces. Then 63 sectors / track indicates that each track is divided into 63 sectors. There are 36468 cylinders in total, and the cylinder is the smallest unit of the partition; The third line indicates that each cylindrical unit is 8225280 byets, and the cylindrical unit size = number of heads * number of sectors per track * sector size = 255 * 63 * 512b = 8225280b; The fourth line indicates that the size of the sector is 512b; The fifth line shows that the minimum and optimal storage unit of the hard disk is 512 bytes, which is equal to the sector size, because the sector is the minimum storage unit of the hard disk; The sixth line indicates that the hard disk identifier is 0x0009808c. The seventh line indicates the meaning of the parameters related to each partition. Device: partition name; Boot: whether it is an active partition. The active partition can only be the primary partition, and a hard disk can only have one active primary partition; The total number of primary partitions and extended partitions of a hard disk cannot exceed 4. The hard disk partition follows the order principle of "main partition → extended partition → logical partition", while deleting partition is the opposite. Primary partition: a hard disk can be divided into multiple primary partitions, but there is no need to divide so many. One is enough. Extended partition: the hard disk space outside the primary partition is the extended partition, Logical partition: it is obtained by re dividing the extended partition. Start: start subscript of partition cylinder; End: end subscript of partition cylinder; Blocks: the number of blocks in this partition. The current file system block = 2 * sector, so the number of blocks = (end start) * the number of sectors of the cylinder / 2 = 1305 * 255 * 63 / 2 = 10482412.5; ID: the file systems of various partitions are different, such as NTFS partition, FAT32 partition, ext3 partition, swap partition, etc. Each file system has a code corresponding to the ID here. Common file system IDS are: f: FAT32 extend, limited to extended partitions. 86:NTFS。 7:HPFS/NTFS b:FAT32。 83:Linux Ext2。 82: Linux swap area. System: file system name. Summary: Size of a disk = size of a cylinder * total number of cylinders = number of heads * number of sectors on each track * size of a sector * total number of cylinders Namely: Disk size = 8225280 * 36468 = 2999511040 bytes = 299gb = 255 * 63 * 512 * 36468 The hard disk size shown in the above example is slightly different from the actual calculation. Don't worry about it. The data displayed by Linux will not be very accurate. (2) Partition and mount the specified device. Step 1: select the disk to be operated and enter the question and answer interface. fdisk /dev/sdb Second, enter m to list the commands that can be executed. Command (m for help): m Command 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) Step 3, enter p to list the current partition of the disk. Disk /dev/sda: 300.0 GB, 299966445568 bytes 255 heads, 63 sectors/track, 36468 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: 0x0009808c Device Boot Start End Blocks Id System /dev/sda1 * 1 1306 10485760 83 Linux /dev/sda2 1306 1566 2088960 82 Linux swap / Solaris /dev/sda3 1566 4177 20971520 83 Linux /dev/sda4 4177 36469 259387694 83 Linux Step 4, enter D and select the partition to delete the existing partition. Command (m for help): d Partition number (1-4): 1 Command (m for help): d Selected partition 2 Command (m for help): d Selected partition 3 Command (m for help): d Selected partition 4 Step 5: enter n to create a new disk partition. First, create two main disk partitions. Command (m for help): n Command action e extended p primary partition (1-4) P / / create a primary partition Partition number (1-4): 1 / / partition number First cylinder (1-391, default 1): / / partition start position Using default value 1 Last cylinder or + size or + sizem or + sizek (1-391, default 391): 100 / / end position of partition, unit: cylinder Command (m for help): n / / create another primary partition Command action e extended p primary partition (1-4) p Partition number (1-4): 2 / / the partition number is 2 First cylinder (101-391, default 101): Using default value 101 Last cylinder or + size or + sizem or + sizek (101-391, default 391): + 200m / / end of partition, unit: M Step 7: confirm that the partition is established successfully. Command (m for help): p Disk /dev/sdb: 3221 MB, 3221225472 bytes 255 heads, 63 sectors/track, 391 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 100 803218+ 83 Linux /dev/sdb2 101 125 200812+ 83 Linux Step 8, create a logical partition. Command (m for help): n Command action e extended p primary partition (1-4) E / / select an extended partition Partition number (1-4): 3 First cylinder (126-391, default 126): Using default value 126 Last cylinder or +

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us