歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux下分區與加密詳解

Linux下分區與加密詳解

日期:2017/2/28 14:51:14   编辑:Linux教程

Linux是一類Unix計算機操作系統的統稱。Linux操作系統的內核的名字也是“Linux”。如何對linux系統進行分區和分區加密呢?下文給出了詳細的描述。

RedHat企業6中有強大的圖形分區工具,這裡我分享下我所了解的通過命令行對磁盤進行分區。

1、分區

  1. [root@burvis~]#fdisk/dev/sda
  2. WARNING:DOS-compatiblemodeisdeprecated.It'sstronglyrecommendedto
  3. switchoffthemode(command'c')andchangedisplayunitsto
  4. sectors(command'u').
  5. Command(mforhelp):

這裡如果你用虛擬機的話可以用#fdisk-cu/dev/vda

這裡我用虛擬機作演示

我們先按m獲取幫助

  1. Commandaction
  2. atoggleabootableflag
  3. beditbsddisklabel
  4. ctogglethedoscompatibilityflag
  5. ddeleteapartition
  6. llistknownpartitiontypes
  7. mprintthismenu
  8. naddanewpartition
  9. ocreateanewemptyDOSpartitiontable
  10. pprintthepartitiontable
  11. qquitwithoutsavingchanges
  12. screateanewemptySundisklabel
  13. tchangeapartition'ssystemid
  14. uchangedisplay/entryunits
  15. vverifythepartitiontable
  16. wwritetabletodiskandexit
  17. xextrafunctionality(expertsonly)

這裡主要用到的有

n新建一個分區

d刪除一個分區

t改變分區類型(進去後按l可以查看所有類型)

p查看分區狀況

w寫入並退出

q退出不寫入

m獲取幫助

接下來我們p查看分區信息

  1. Command(mforhelp):p
  2. Disk/dev/vda:6442MB,6442450944bytes
  3. 16heads,63sectors/track,12483cylinders,total12582912sectors
  4. Units=sectorsof1*512=512bytes
  5. Sectorsize(logical/physical):512bytes/512bytes
  6. I/Osize(minimum/optimal):512bytes/512bytes
  7. Diskidentifier:0x0008f7fd
  8. DeviceBootStartEndBlocksIdSystem
  9. /dev/vda1*204852633526214483Linux
  10. /dev/vda2526336991436746940168eLinuxLVM

按n新建一個分區

  1. Command(mforhelp):p
  2. Disk/dev/vda:6442MB,6442450944bytes
  3. 16heads,63sectors/track,12483cylinders,total12582912sectors
  4. Units=sectorsof1*512=512bytes
  5. Sectorsize(logical/physical):512bytes/512bytes
  6. I/Osize(minimum/optimal):512bytes/512bytes
  7. Diskidentifier:0x0008f7fd
  8. DeviceBootStartEndBlocksIdSystem
  9. /dev/vda1*204852633526214483Linux
  10. /dev/vda2526336991436746940168eLinuxLVM

這裡按e為擴展分區,p為主分區

我們建一個擴展分區

輸入e

選擇第三個分區

選擇起始點,可以直接回車選擇默認

選擇終止點,這裡可以像我一樣用+1G,表示給1G的空間,或者可以直接輸入終止點的位置

  1. e
  2. Partitionnumber(1-4):3
  3. Firstsector(9914368-12582911,default9914368):
  4. Usingdefaultvalue9914368
  5. Lastsector,+sectorsor+size{K,M,G}(9914368-12582911,default12582911):+1G
Copyright © Linux教程網 All Rights Reserved