国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > CentOS > 正文

在CentOS系統上格式化邏輯分區的方法

2020-07-08 12:52:34
字體:
來源:轉載
供稿:網友
磁盤容量與主分區、擴展分區、邏輯分區的關系:

硬盤的容量=主分區的容量+擴展分區的容量

擴展分區的容量=各個邏輯分區的容量之和

一塊物理硬盤只能有: 一到四個主分區(但其中只能有一個是活動的主分區),或一到三個主分區,和一個擴展分區。分別對應hda1,hda2,hda3,hda4.

Linux 中規定,每一個硬盤設備最多能有 4 個主分區(其中包含擴展分區)構成,任何一個擴展分區都要占用一個主分區號碼,也就是在一個硬盤中,主分區和擴展分區一共最多是 4 個。

我曾經的困惑點是:不知道擴展分區要占用主分區(最多可以有4個)一個分區號碼。

我的總結:一塊硬盤可以只設主分區,這時主分區可設置4個分區號。也可以設置成主分區+邏輯分區,這時也是最多4個分區號碼,但是變成了4 = 3 + 1.其中4是主分區和擴展分區加起來最多4個; 3是主分區,可以小于或等于3; 1是擴展分區號,占用了一個主分區號。從5開始到16,都是邏輯分區。如果只有一個5,則擴展分區不再進行分區了,那么擴展分區就是邏輯分區了(擴展分區的磁盤總量等于一個邏輯分區的磁盤總量)。常見的是擴展分區被分成幾個邏輯分區,用5,6,7,8等號碼標識。

如果你在Linux系統中格式化磁盤時遇到如下錯誤,那么表示你正在格式化一個擴展分區。

復制代碼
代碼如下:

[root@GETTestLNX06 ~]# mkfs.ext4 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)

mkfs.ext4: inode_size (128) * inodes_count (0) too big for a

filesystem with 0 blocks, specify higher inode_ratio (-i)

or lower inode count (-N).

直接格式化擴展分區是不允許的,只能格式化主分區和邏輯分區。那么那么應該如何格式化一個擴展分區呢,我們要么刪除該擴展分區,創建一個主分區;要么在擴展分區上創建邏輯分區,如下操作所示
 
1: 創建邏輯分區

復制代碼
代碼如下:

[root@GETTestLNX06 ~]# fdisk /dev/sdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): p

Disk /dev/sdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 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: 0xd61351c9

Device Boot Start End Blocks Id System
/dev/sdb1 1 13054 104856223+ 5 Extended

Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (1-13054, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-13054, default 13054):
Using default value 13054

Command (m for help): p

Disk /dev/sdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 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: 0xd61351c9

Device Boot Start End Blocks Id System
/dev/sdb1 1 13054 104856223+ 5 Extended
/dev/sdb5 1 13054 104856192 83 Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

2:格式化邏輯分區

復制代碼
代碼如下:

[root@GETTestLNX06 ~]# mkfs.ext4 /dev/sdb5
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
6553600 inodes, 26214048 blocks
1310702 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
800 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

3:將掛載信息寫入配置文件

編輯
復制代碼
代碼如下:
[root@GETTestLNX06 ~]# vi /etc/fstab

http://img.jbzj.com/file_images/article/201510/20151022114037141.png?2015922114052

4:掛載新建的分區

復制代碼
代碼如下:

[root@GETTestLNX06 ~]# cd /
[root@GETTestLNX06 /]# mkdir u01
[root@GETTestLNX06 /]# mount -a
[root@GETTestLNX06 /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_gettestlnx06-lv_root
44G 2.3G 40G 6% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/sda1 477M 33M 419M 8% /boot
/dev/sdb5 99G 60M 94G 1% /u01
[root@GETTestLNX06 /]#



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 三门峡市| 万宁市| 石嘴山市| 大同县| 布尔津县| 泰安市| 遵义市| 仙桃市| 广南县| 武宁县| 云阳县| 苏尼特左旗| 石泉县| 富锦市| 石狮市| 唐海县| 卢湾区| 盐山县| 舟曲县| 平远县| 永嘉县| 株洲市| 江达县| 思茅市| 南汇区| 安塞县| 黎川县| 个旧市| 灵武市| 丽江市| 屏山县| 水城县| 余庆县| 浙江省| 化德县| 望都县| 乌恰县| 安顺市| 香格里拉县| 临澧县| 定兴县|