fdisk的命令
bfdisk的命令
參考
[@more@]#檢視fdisk的命令[root@cnscn ~]# fdisk /dev/sdb
Command (m for help): m
Command action
a 設定成可引導分割槽 toggle a bootable flag
b 編輯BSD分割槽的磁碟卷標 edit bsd disklabel
c 設定成與DOS相容的分割槽 toggle the dos compatibility flag
d 刪除分割槽 delete a partition
l 列出所有支援的分割槽檔案系統型別 list known partition types
m 幫助命令 print this menu
n 建立新的分割槽 add a new partition
o 建立新的DOS分割槽 create a new empty DOS partition table
p 列出目前分割槽的狀態 print the partition table
q 不儲存分割槽更改而退出 quit without saving changes
s 建立新的SUN分割槽 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)
================== [分割槽與格式化開始] ========================
[root@cnscn ~]# fdisk /dev/sdb
The number of cylinders for this disk is set to 4863.
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)
#檢視/dev/sdb盤內的分割槽情況
Command (m for help): p
Disk /dev/sdb: 40.0 GB, 40007761408 bytes
255 heads, 63 sectors/track, 4863 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 3590 28836643+ 6 FAT16
#刪除現有分割槽1
Command (m for help): d 1
No partition is defined yet!
#檢視刪除分割槽後的分割槽情況
Command (m for help): p
Disk /dev/sdb: 40.0 GB, 40007761408 bytes
255 heads, 63 sectors/track, 4863 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
[已經沒有分割槽了]
#建立一個新分割槽
Command (m for help): n
Command action
e extended 擴充套件分割槽
p primary partition (1-4) 主分割槽
#選擇主分割槽
p
#分割槽號選1(因為此時是我們建立的第一個/dev/sdb的分割槽即/dev/sdb1)
Partition number (1-4): 1
First cylinder (1-4863, default 1): 開始盤柱為1,直接回車採用預設
Using default value 1
#最後一個盤柱或大小,注意這裡的 +
Last cylinder or +size or +sizeM or +sizeK (1-4863, default 4863): +10240M
#檢視分割槽情況
Command (m for help): p
Disk /dev/sdb: 40.0 GB, 40007761408 bytes
255 heads, 63 sectors/track, 4863 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1246 10008463+ 83 Linux
#如上來建立第二個分割槽,只是要注意引數的變化
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p#建立第2個分割槽
Partition number (1-4): 2
#開始盤柱,採用預設
First cylinder (1247-4863, default 1247):
Using default value 1247
#結束盤柱,採用預設
Last cylinder or +size or +sizeM or +sizeK (1247-4863, default 4863):
Using default value 4863
#檢視最後的分割槽情況
Command (m for help): p
Disk /dev/sdb: 40.0 GB, 40007761408 bytes
255 heads, 63 sectors/track, 4863 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1246 10008463+ 83 Linux
/dev/sdb2 1247 4863 29053552+ 83 Linux
#修改第2個分割槽的檔案系統型別為FAT32
#執行修改檔案系統型別命令t
Command (m for help): t
#選擇要修改檔案系統型別的分割槽號2
Partition number (1-4): 2
#選擇FAT32分割槽的型別號bHex code (type L to list codes): b
Changed system type of partition 2 to b (W95 FAT32)
#檢視修改後的分割槽結果
Command (m for help): p
Disk /dev/sdb: 40.0 GB, 40007761408 bytes
255 heads, 63 sectors/track, 4863 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1246 10008463+ 83 Linux
/dev/sdb2 1247 4863 29053552+ b W95 FAT32
#儲存修改後的分割槽表,並退出
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
#格式化/dev/sdb1分割槽為ext3型別
[root@cnscn ~]# mkfs.ext3 /dev/sdb1
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1251712 inodes, 2502115 blocks
125105 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2562719744
77 block groups
32768 blocks per group, 32768 fragments per group
16256 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
#格式化/dev/sdb2分割槽為FAT32型別
[root@cnscn ~]# mkfs.vfat /dev/sdb2
mkfs.vfat 2.11 (12 Mar 2005)
#檢視系統分割槽列表
[root@cnscn ~]# fdisk -l
...
Disk /dev/sdb: 40.0 GB, 40007761408 bytes
255 heads, 63 sectors/track, 4863 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1246 10008463+ 83 Linux
/dev/sdb2 1247 4863 29053552+ b W95 FAT32
================== [分割槽與格式化完畢] ========================
================== [測試分割槽開始] ==========================
[root@cnscn ~]# mount -t auto -o rw /dev/sdb1 /media/usb/
[root@cnscn ~]# cd /media/usb/
[root@cnscn usb]# ls
cllost+found
[root@cnscn usb]# touch a.txt
[root@cnscn usb]# ls
a.txt lost+found
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/161840/viewspace-944393/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux命令之fdiskLinux
- fdisk -l命令有什麼用?fdisk -l詳解
- 【Linux系統】fdisk相關分割槽命令。Linux
- linux磁碟分割槽格式化-fdisk命令工具Linux
- linux-fdiskLinux
- Linux:fdisk指令Linux
- 如何使用Fdisk來快速重建隨身碟分割槽?Fdisk快速重建隨身碟分割槽的方法步驟
- linux 磁碟分割槽掛載-fdiskLinux
- 『學了就忘』Linux檔案系統管理 — 59、使用fdisk命令進行手工分割槽Linux
- 分割槽管理工具 fdisk parted
- linux fdisk 分割槽、格式化、掛載!Linux
- parted和fdisk——兩種磁碟分割槽並掛載的方法
- fdisk 更改分割槽容量遇到問題,還以為是oracle asm的問題OracleASM
- 檔案系統管理 之 例項解說 fdisk 使用方法
- fdisk時WARNING: Re-reading the partition table failed with error 16: 裝置或資源忙 的問題解決方案AIError
- Linux系統中的管道命令、grep命令、sed命令和awk命令Linux
- sed命令和find命令的結合的使用
- 收集 Linux 命令列執行的命令Linux命令列
- Git的命令Git
- 【Redis】Redis的操作命令(一)——Redis Key命令Redis
- Docker 最常用的映象命令和容器命令Docker
- CAD繪圖命令中的圓弧命令繪圖
- 把Oracle的命令輸出傳送到檔案的命令Oracle
- 命令注入-命令的連線符【‘&’‘&&’‘||’‘|’】的含義及其用法
- mac 的tar命令--exclude和linux的tar命令--exclude的區別MacLinux
- 常用的docker命令Docker
- 常用的 Homebrew 命令
- 常用的ADB命令
- redis的command命令Redis
- PHP 命令的使用PHP
- Linux的stat命令Linux
- nohup 命令的使用
- 常用的 nginx 命令Nginx
- MySQL 的 help 命令MySql
- linux 的cp命令Linux
- linux的awk命令Linux
- 常用的 maven 命令Maven
- Docker常用的命令Docker
- 基本的Dos命令