<em id="0a85b"><option id="0a85b"></option></em>

<abbr id="0a85b"></abbr>

      <nobr id="0a85b"></nobr>
        <tr id="0a85b"></tr>
        9久久伊人精品综合,亚洲一区精品视频在线,成 人免费va视频,国产一区二区三区黄网,99国产精品永久免费视频,亚洲毛片多多影院,精品久久久无码人妻中文字幕,无码国产欧美一区二区三区不卡
        學習啦 > 學習電腦 > 操作系統 > Linux教程 > Linux下Fdisk分區詳解

        Linux下Fdisk分區詳解

        時間: 志藝942 分享

        Linux下Fdisk分區詳解

          那么你知道Linux下Fdisk分區詳解么?接下來是小編為大家收集的Linux下Fdisk分區詳解,歡迎大家閱讀:

          Linux下Fdisk分區詳解

          1、 通過Fdisk查看系統分區詳細信息:

          Fdisk –l 詳解:

          [root@jetsenLin ~]# fdisk -l

          Disk /dev/sda: 10.7 GB, 10737418240 bytes

          255 heads, 63 sectors/track, 1305 cylinders

          Units = cylinders of 16065 * 512 = 8225280bytes

          注釋:這個硬盤的大小是10.7GB,有255個磁面,63個扇區,1305磁柱(cylinders)

          每個cylinder(磁柱)的容量是 8225280 bytes=8225.280 K(約為)=8.225280M(約為);

          Device Boot Start End Blocks Id System

          /dev/sda1 * 1 13 104391 83 Linux

          /dev/sda2 14 1305 10377990 8e Linux LVM

          id和System 表示的是一個意思,id看起來不太直觀,我們要在fdisk 一個分區時,通過指定id來確認分區類型;比如 7表示的就NTFS 分區;這個在fdisk 中要通過t功能來指定。下面的部分會提到;

          Disk /dev/sdb: 21.4 GB,21474836480 bytes

          255 heads, 63 sectors/track, 2610 cylinders

          Units = cylinders of 16065 * 512 = 8225280bytes

          Disk /dev/sdb doesn't contain a validpartition table

          說明:硬盤分區的表示:在Linux 是通過hd*x 或 sd*x 表示的:

          其中* 表示的是a、b、c ... ...

          另外x 表示的數字 1、2、3 ... ...

          hd大多是IDE硬盤;sd大多是SCSI或移動存儲;引導(Boot):表示引導分區,在上面的例子中sda1 是引導分區;

          Start (開始):表示的一個分區從Xcylinder(磁柱)開始;

          End (結束):表示一個分區到 Ycylinder(磁柱)結束;

          2、 學會使用fdisk幫助功能:

          [root@jetsenLin~]# fdisk /dev/sda

          Thenumber of cylinders for this disk is set to 1305.

          There isnothing wrong with that, but this is larger than 1024,

          and couldin certain setups cause problems with:

          1) softwarethat 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 ---輸出幫助信息

          Commandaction

          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 --創建一個新的空白DOS分區表

          p print the partition table ---打印分區表

          q quit without saving changes ---退出不保存設置

          s createa new empty Sun disklabel ---

          t changea partition's system id ---改變分區的ID

          u changedisplay/entry units ---改變顯示的單位

          v verifythe partition table ---檢查驗證分區表

          w write table to disk and exit ---保存分區表

          x extra functionality (experts only)

          Command (m for help):

          3、 通過Fdisk對磁盤分區進行操作:

          Fdisk 創建分區:

          [root@jetsenLin ~]#fdisk /dev/sdb

          Device contains neither a valid DOSpartition table, nor Sun, SGI or OSF disklabel

          Building a new DOS disklabel. Changes willremain in memory only,

          until you decide to write them. After that,of course, the previous

          content won't be recoverable.

          The number of cylinders for this disk isset to 2610.

          There is nothing wrong with that, but thisis larger than 1024,

          and could in certain setups cause problemswith:

          1) software that runs at boot time (e.g.,old versions of LILO)

          2) booting and partitioning software fromother OSs

          (e.g., DOS FDISK, OS/2 FDISK)

          Warning: invalid flag 0x0000 of partitiontable 4 will be corrected by w(rite)

          Command (m for help): n ---輸入m會有幫助信息出來,輸入n不打印幫助信息

          Command action

          e extended

          p primary partition (1-4) ---指定分區類型 e為擴展分區 p為主分區

          p

          Partition number (1-4): 1 ---定義分區數量 --主分區最多只能有四個

          First cylinder (1-2610, default 1): 1 ---設定起始分區的位置

          Last cylinder or +size or +sizeM or +sizeK(1-2610, default 2610):

          Using default value 2610 ---設定結束分區的位置

          Command (m for help): w ---保存剛才的配置信息。

          The partition table has been altered!

          Calling ioctl() to re-read partition table.

          Syncing disks.

          [root@jetsenLin ~]#

          Fdisk 刪除分區:

          [root@jetsenLin ~]# fdisk /dev/sdb

          The number of cylinders for this disk isset to 2610.

          There is nothing wrong with that, but thisis larger than 1024,

          and could in certain setups cause problemswith:

          1) software that runs at boot time (e.g.,old versions of LILO)

          2) booting and partitioning software fromother OSs

          (e.g., DOS FDISK, OS/2 FDISK)

          Command (m for help): d ---d 是代表刪除,并且會列出當前磁盤的分區數。

          Selected partition 1

          Command (m for help): p ----p 是代表刪除后,顯示磁盤還有幾個剩余的分區。

          Disk /dev/sdb: 21.4 GB, 21474836480 bytes

          255 heads, 63 sectors/track, 2610 cylinders

          Units = cylinders of 16065 * 512 = 8225280bytes

          Device Boot Start End Blocks Id System ----已經沒有分區了

          Command (m for help): w ----保存剛才的操作并且生效

          The partition table has been altered!

          Calling ioctl() to re-read partition table.

          WARNING: Re-reading the partition tablefailed with error 16: Device or resource busy.

          The kernel still uses the old table.

          The new table will be used at the nextreboot.

          這里報了一錯誤,分區表正在使用,刪除再下次啟動生效

          Syncing disks. ---同步新的磁盤信息

          [root@jetsenLin ~]# fdisk -l /dev/sdb

          Disk /dev/sdb: 21.4 GB, 21474836480 bytes

          255 heads, 63 sectors/track, 2610 cylinders

          Units = cylinders of 16065 * 512 = 8225280bytes

          Device Boot Start End Blocks Id System

          通過fdisk 命令來創建一指定大小的分區并增加一個分區

          Fdisk n

          創建分區:

          [root@jetsenLin ~]# fdisk /dev/sdb

          The number of cylinders for this disk isset to 2610.

          There is nothing wrong with that, but thisis larger than 1024,

          and could in certain setups cause problemswith:

          1) software that runs at boot time (e.g.,old versions of LILO)

          2) booting and partitioning software fromother OSs

          (e.g., DOS FDISK, OS/2 FDISK)

          Command (m for help): n ---創建分區

          Command action

          e extended

          p primary partition (1-4) --指定分區類型為主分區

          p

          Partition number (1-4): 1 --指定其實分區號

          First cylinder (1-2610, default 1): 1 --指定起始柱面號

          Last cylinder or +size or +sizeM or +sizeK(1-2610, default 2610): 1024 ---指定終止柱面號

          Command (m for help): w ---保存分區配置信息

          The partition table has been altered!

          Calling ioctl() to re-read partition table.

          WARNING: Re-reading the partition tablefailed with error 16: Device or resource busy.

          The kernel still uses the old table.

          The new table will be used at the nextreboot.

          Syncing disks.

          增加分區:

          [root@jetsenLin ~]# fdisk /dev/sdb -----增加分區

          The number of cylinders for this disk isset to 2610.

          There is nothing wrong with that, but thisis larger than 1024,

          and could in certain setups cause problemswith:

          1) software that runs at boot time (e.g.,old versions of LILO)

          2) booting and partitioning software fromother OSs

          (e.g., DOS FDISK, OS/2 FDISK)

          Command (m for help): n ---分區類型

          Command action

          e extended

          p primary partition (1-4) ---還是指定主分區

          p

          Partition number (1-4): 1 ---分區號,我指定1。

          Partition 1is already defined. Delete it beforere-adding it.

          –提示分區號1已經存在,刪除后操作

          Command (m for help): n --我們重新創建分區

          Command action

          e extended

          p primary partition (1-4) --指定分區類型

          p

          Partition number (1-4): 2 ---因為分區1已經存在,所以我們指定分區2,可通過。

          First cylinder (1025-2610, default 1025): ---指定起始礠柱號,默認是上一分區后一號。

          Using default value 1025

          Last cylinder or +size or +sizeM or +sizeK(1025-2610, default 2610): 2000 --指定終止礠柱號。 www.2cto.com

          Command (m for help): w ---保存分區配置

          The partition table has been altered!

          Calling ioctl() to re-read partition table.

          WARNING: Re-reading the partition tablefailed with error 16: Device or resource busy.

          The kernel still uses the old table.

          The new table will be used at the nextreboot.

          Syncing disks.

          [root@jetsenLin ~]#

          通過fdisk命令來來修改現有分區類型

          Fdisk 通過t參數來指定

          查看分區類型

          [root@jetsenLin ~]# fdisk -l /dev/sdb 查看分區信息,類型是Linux,id是83

          Disk /dev/sdb: 21.4 GB, 21474836480 bytes

          255 heads, 63 sectors/track, 2610 cylinders

          Units = cylinders of 16065 * 512 = 8225280bytes

          Device Boot Start End Blocks Id System

          /dev/sdb1 1 1024 8225248+ 83 Linux

          /dev/sdb2 1025 2000 7839720 83 Linux

          修改分區類型

          [root@jetsenLin ~]# fdisk /dev/sdb

          The number of cylinders for this disk isset to 2610.

          There is nothing wrong with that, but thisis larger than 1024,

          and could in certain setups cause problemswith:

          1) software that runs at boot time (e.g.,old versions of LILO)

          2) booting and partitioning software fromother OSs

          (e.g., DOS FDISK, OS/2 FDISK)

          Command (m for help): t ---進入修改分區類型

          Partition number (1-4): 1 ---指定需要修改的分區號

          Hex code (type L tolist codes): 6 ---指定分區號為6,也就是FAT16

          注意:查看分區類型的代碼,在這里可以輸入L查看就可以了

          Changed system type of partition 1 to 6(FAT16)

          Command (m for help): w ---保存

          The partition table has been altered!

          Calling ioctl() to re-read partition table.

          WARNING: Re-reading the partition tablefailed with error 16: Device or resource busy.

          The kernel still uses the old table.

          The new table will be used at the nextreboot.

          WARNING: If you have created or modifiedany DOS 6.x

          partitions, please see the fdisk manualpage for additional

          information.

          Syncing disks.

          [root@jetsenLin ~]# fdisk -l /dev/sdb ---我們看到已經FAT16,并且ID也改成6了。

          Disk /dev/sdb: 21.4 GB, 21474836480 bytes

          255 heads, 63 sectors/track, 2610 cylinders

          Units = cylinders of 16065 * 512 = 8225280bytes

          Device Boot Start End Blocks Id System

          /dev/sdb1 1 1024 8225248+ 6 FAT16

          /dev/sdb2 1025 2000 7839720 83 Linux

          [root@jetsenLin ~]#

          4、 對分區進行格式化及加載:

          對分區進行格式化的命令如下等,mkfs后面所接的代表的是將要格式化成的文件系統類型:

          mkfs.bfs

          mkfs.ext2

          mkfs.ext3

          mkfs.jfs

          mkfs.msdos

          mkfs.vfat

          mkfs.cramfs

          mkfs.minix

          mkfs.reiserfs

          mkfs.xfs

          格式化分區:

          [root@jetsenLin ~]# mkfs.ext4 /dev/sdb1 ---格式化分區類型為ext4

          mke4fs 1.41.5(23-Apr-2009)

          Filesystem label= ---我們沒有指定卷標,就沒有

          OS type: Linux ---操作系統類型

          Block size=4096 (log=2) --單個塊的大小

          Fragment size=4096 (log=2) --片大小

          1310720 inodes, 5241198blocks

          262059 blocks (5.00%)reserved for the super user

          First data block=0

          Maximum filesystem blocks=0

          160 block groups

          32768 blocks per group, 32768fragments per group

          8192 inodes per group

          Superblock backups stored on blocks:

          32768, 98304, 163840, 229376, 294912,819200, 884736, 1605632, 2654208,

          4096000 www.2cto.com

          Writing inode tables:done

          Creating journal (32768blocks): done

          Writing superblocks andfilesystem accounting information: done

          This filesystem will beautomatically checked every 27 mounts or

          180 days, whichever comesfirst. Use tune4fs -c or -i to override.

          掛載磁盤:(臨時掛載)

          [root@jetsenLin ~]# mkdir/data --創建掛載目錄點

          [root@jetsenLin ~]#mount /dev/sdb1 /data --將/dev/sdb1 掛載到/data

          驗證是否成功掛載

          [root@jetsenLin ~]# df -h

          Filesystem Size Used Avail Use% Mounted on

          /dev/mapper/VolGroup00-LogVol00

          7.7G 3.1G 4.2G 43% /

          /dev/sda1 99M 12M 82M 13% /boot

          tmpfs 506M 0 506M 0% /dev/shm

          /dev/sdb1 20G 16K 20G 1% /data --我們看到已經成功掛載了。

          [root@jetsenLin ~]#

          掛載磁盤:(永久掛載)

          通過vi編輯器編輯/etc/fstab文件,內容如下,(紅色部分是剛添加上去的):

          掛載路徑 掛載的分區 文件系統 掛載參數 是否要備份 自檢順序

          /dev/VolGroup00/LogVol00/ ext3 defaults 1 1

          LABEL=/boot /boot ext3 defaults 1 2

          tmpfs /dev/shm tmpfs defaults 0 0

          devpts /dev/pts devpts gid=5,mode=620 0 0

          sysfs /sys sysfs defaults 0 0

          proc /proc proc defaults 0 0

          /dev/VolGroup00/LogVol01swap swap defaults 0 0

          /data /dev/sdb1 ext4 default 0 0

          第四列掛載參數:通過查看man mount 來查看

          第五列是否要備份:(0為不備份,1為要備份,一般情況下不用做備份)

          第六列自檢程序 (0為不自檢,1或2為要自檢,如果是根分區要設置1,其它分區只能是2)

          
        看了“Linux下Fdisk分區詳解”還想看:

        1.linux下磁盤怎么分區(2)

        2.Linux下的GPT分區教程

        3.Linux磁盤管理GPT分區教程

        4.linux系統硬盤怎么格式化

        2918567 主站蜘蛛池模板: 日本高清视频色欧WWW| 女人高潮被爽到呻吟在线观看| 最新国产AV最新国产在钱| 午夜免费视频国产在线| 午夜免费视频国产在线| 亚洲 卡通 欧美 制服 中文| 男女啪啪激烈无遮挡动态图| 亚洲国产精品午夜福利| 久久88香港三级台湾三级播放| 国产精品成人网址在线观看 | 日韩美女av二区三区四区| 国产精品不卡一区二区三区 | 国内少妇毛片视频| 91精品乱码一区二区三区| 性人久久久久| 亚洲精品码中文在线观看| 亚洲夂夂婷婷色拍ww47| 国产精品亚洲аv无码播放| 欧美成人aaa片一区国产精品| 亚洲美女视频一区| 亚洲日本乱码一区二区在线二产线| 素人视频亚洲十一十二区| 免费国产99久久久香蕉| 国产熟女肥臀精品国产馆乱| 成人性生交片无码免费看| 欧美人与动牲交精品| 国产成人精品97| 人妻聚色窝窝人体WWW一区| 给我免费观看片在线| 高h喷水荡肉爽文1v1| A级日本乱理伦片免费入口| 精品久久蜜桃| 日韩精品国产二区三区| 亚洲爽爆av一区二区| 福利视频一区二区在线| 欧美 国产 人人视频| 亚洲区一区二区三区亚洲| 精品国产中文字幕在线| 变态另类视频一区二区三区| 国产精品久久久久鬼色| 久久精品国产色蜜蜜麻豆|