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

linux操作系統分區

時間: 春健736 分享

linux操作系統分區

  本文就用戶在裝Linux操作系統的過程中,所遇到的Linux操作系統分區問題來詳細地介紹一下,下面大家與學習啦小編一起來學習一下吧。

  linux操作系統分區

  每塊硬盤的 MBR 最多只能存儲 4 個分區信息,也就是說每塊物理硬盤我們最多分成4個主分區(P + P + P + P),或者3個主分區外加一個擴展分區(P + P + P + E)。如果我們希望劃分更多的分區,可以將擴展分區劃分更多更小的邏輯分區。

  Linux 將編號 1 ~ 4 固定分配給 4 個主要分區。也就是說即便我們只有 1 個主分區和 1 個擴展分區,那第一個邏輯分區也只能是 hda5 (或 sda5)。

  談論 Linux 分區時和 Windows 有很大的不同,因為這些分區通常以某個目錄方式存在 (或者說掛載點)。

  /: 默認掛載點,未指定的目錄都將存放在分區中。

  /home: 用戶主目錄,相當于 Windows 的 Documents and Settings,存放各用戶的相關數據文件,適合單獨分區。

  /usr: 各種執行程序安裝目錄,相當于 Windows 的 Program files 和 Winnt 目錄。建議單獨分區。

  /var: 通常用于存放各種臨時文件和緩存文件,容易產生磁盤碎片,建議單獨分區。

  當然,別忘了充當虛擬內存 swap 分區。

  以下是我個人習慣的分區方式。

  /: 1GB ~ 2GB。

  /usr: 1GB ~ 2GB,依據需要安裝的服務和軟件而定。

  swap: 通常是物理內存的 2 倍,但似乎沒必要超過 1GB。

  /home: 所有剩余空間

  /var: 1GB 左右

  我們用 Fdisk 對一個 8GB 的硬盤做一個分區演示。

  yuhen@yuhen-desktop:~$ sudo fdisk /dev/sdb

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

  Building a new DOS disklabel with disk identifier 0x416ba19a.

  Changes will remain 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 is set to 1044.

  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)

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

  Command (m for help): p # 查看分區信息

  Disk /dev/sdb: 8589 MB, 8589934592 bytes

  255 heads, 63 sectors/track, 1044 cylinders

  Units = cylinders of 16065 * 512 = 8225280 bytes

  Disk identifier: 0x416ba19a

  Device Boot Start End Blocks Id System

  Command (m for help): n # 新建主分區 /

  Command action

  e extended

  p primary partition (1-4)

  p # 新建主分區

  Partition number (1-4): 1 # 分區編號

  First cylinder (1-1044, default 1): # 開始柱面,通常用默認值

  Using default value 1

  Last cylinder, +cylinders or +size{K,M,G} (1-1044, default 1044): +1024M # 分區大小 1GB。

  Command (m for help): n # 新建主分區 /usr

  Command action

  e extended

  p primary partition (1-4)

  p

  Partition number (1-4): 2

  First cylinder (133-1044, default 133):

  Using default value 133

  Last cylinder, +cylinders or +size{K,M,G} (133-1044, default 1044): +1024M

  Command (m for help): n # 新建主分區 swap

  Command action

  e extended

  p primary partition (1-4)

  p

  Partition number (1-4): 3

  First cylinder (265-1044, default 265):

  Using default value 265

  Last cylinder, +cylinders or +size{K,M,G} (265-1044, default 1044): +512M

  Command (m for help): n # 新建擴展分區

  Command action

  e extended

  p primary partition (1-4)

  e

  Selected partition 4

  First cylinder (331-1044, default 331):

  Using default value 331

  Last cylinder, +cylinders or +size{K,M,G} (331-1044, default 1044): # 全部剩余空間

  Using default value 1044

  Command (m for help): p # 查看分區

  Disk /dev/sdb: 8589 MB, 8589934592 bytes

  255 heads, 63 sectors/track, 1044 cylinders

  Units = cylinders of 16065 * 512 = 8225280 bytes

  Disk identifier: 0x416ba19a

  Device Boot Start End Blocks Id System

  /dev/sdb1 1 132 1060258+ 83 Linux

  /dev/sdb2 133 264 1060290 83 Linux

  /dev/sdb3 265 330 530145 83 Linux

  /dev/sdb4 331 1044 5735205 5 Extended

  Command (m for help):

  至此我們完成了 4 個主分區的劃分,接下來為創建邏輯分區。

  Command (m for help): n # 創建 /home 邏輯分區

  First cylinder (331-1044, default 331):

  Using default value 331

  Last cylinder, +cylinders or +size{K,M,G} (331-1044, default 1044): +4096M

  Command (m for help): n # 創建 /var 邏輯分區

  First cylinder (854-1044, default 854):

  Using default value 854

  Last cylinder, +cylinders or +size{K,M,G} (854-1044, default 1044):

  Using default value 1044

  Command (m for help): p # 顯示分區

  Disk /dev/sdb: 8589 MB, 8589934592 bytes

  255 heads, 63 sectors/track, 1044 cylinders

  Units = cylinders of 16065 * 512 = 8225280 bytes

  Disk identifier: 0xe1bd2899

  Device Boot Start End Blocks Id System

  /dev/sdb1 1 132 1060258+ 83 Linux

  /dev/sdb2 133 264 1060290 83 Linux

  /dev/sdb3 265 330 530145 83 Linux

  /dev/sdb4 331 1044 5735205 5 Extended

  /dev/sdb5 331 853 4200966 83 Linux

  /dev/sdb6 854 1044 1534176 83 Linux

  Command (m for help):

  別忘了保存分區表,否則上面的工作就白做了。

  Command (m for help): w

  The partition table has been altered!

  Calling ioctl() to re-read partition table.

  Syncing disks.

  看看效果。

  yuhen@yuhen-desktop:~$ sudo fdisk -l /dev/sdb

  Disk /dev/sdb: 8589 MB, 8589934592 bytes

  255 heads, 63 sectors/track, 1044 cylinders

  Units = cylinders of 16065 * 512 = 8225280 bytes

  Disk identifier: 0x71f06c9b

  Device Boot Start End Blocks Id System

  /dev/sdb1 1 132 1060258+ 83 Linux

  /dev/sdb2 133 264 1060290 83 Linux

  /dev/sdb3 265 330 530145 83 Linux

  /dev/sdb4 331 1044 5735205 5 Extended

  /dev/sdb5 331 853 4200966 83 Linux

  /dev/sdb6 854 1044 1534176 83 Linux

  接下來就是格式化分區了。

  yuhen@yuhen-desktop:~$ sudo mke2fs -j -L "root" /dev/sdb1

  mke2fs 1.41.4 (27-Jan-2009)

  Filesystem label=root

  OS type: Linux

  Block size=4096 (log=2)

  Fragment size=4096 (log=2)

  66384 inodes, 265064 blocks

  13253 blocks (5.00%) reserved for the super user

  First data block=0

  Maximum filesystem blocks=272629760

  9 block groups

  32768 blocks per group, 32768 fragments per group

  7376 inodes per group

  Superblock backups stored on blocks:

  32768, 98304, 163840, 229376

  Writing inode tables: done

  Creating journal (8192 blocks): done

  Writing superblocks and filesystem accounting information: done

  This filesystem will be automatically checked every 27 mounts or

  180 days, whichever comes first. Use tune2fs -c or -i to override.

  給分區設置一個 Label,便于以后管理。

  有關分區掛載點,可查看后續章節。

  下圖是我在 VMware 上安裝 Ubuntu Desktop 9.04 時的分區設置,由于 Desktop 默認集成了一些軟件,因此對 "/" 和 "/usr" 有最小尺寸限制。


655876 主站蜘蛛池模板: 亚洲国产大片永久免费看| 欧美性猛交xxxx乱大交丰满| 日韩中文字幕综合第二页| 国产美女被遭强高潮免费一视频 | 尤物yw193无码点击进入| 成人午夜大片免费看爽爽爽| 亚洲欧美日韩综合一区在线| 免费av网站| 亚洲一区二区三区四区| 国产一区二区不卡视频在线| 性欧美vr高清极品| 99久久国产福利自产拍| 思思99热精品在线| 伊人av超碰伊人久久久| 精品一区二区亚洲国产| 丰满人妻一区二区三区高清精品 | 中文字幕日韩国产精品| 国产成人高清精品免费软件| 开心五月激情五月俺亚洲| 日韩成人无码影院| 亚洲国产初高中生女av| 唐人社视频呦一区二区| 午夜精品一区二区三区成人| 亚洲天堂领先自拍视频网| 日日碰狠狠躁久久躁96avv| 免费又爽又大又高潮视频| 成人无码特黄特黄AV片在线 | 国产偷国产偷亚洲综合av| 国产精品午夜福利视频| 国产va免费精品观看| 另类 专区 欧美 制服丝袜| 亚洲国产天堂久久综合网| 澳门永久av免费网站| 亚洲AV日韩AV高清在线观看| 2020久久国产综合精品swag| 日韩精品自拍偷拍一区二区| 国产精品成人中文字幕| 久久国产精99精产国高潮| 国产精品美女一区二三区| 久草热在线视频免费播放| AV在线亚洲欧洲日产一区二区|