标签:linux 分区
创建一个扩展分区:
[root@qing init.d]# 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):
Command (m for help): p
Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 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: 0x3c8b5df6
Device
Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e
Partition number (1-4): 1
First cylinder (1-652, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-652, default
652):
Using default value 652
Command (m for help): p
Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 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: 0x3c8b5df6
Device
Boot Start End Blocks Id System
/dev/sdb1 1 652 5237158+ 5 Extended
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@qing init.d]#
格式化:
问题,扩展分区不能格式化,需要创建逻辑分区后格式化
[root@qing init.d]# mkfs -t ext3 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
mkfs.ext3: inode_size (128) * inodes_count (0) too big for a
filesystem with 0 blocks, specify higher inode_ratio (-i)
or lower inode count (-N).
[root@qing init.d]#
创建逻辑分区:
1、查看分区信息
[root@qing init.d]# fdisk -l
Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 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: 0x00062b86
Device
Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 3264 25701376 8e Linux LVM
Disk /dev/sdb: 5368 MB,
5368709120 bytes
255 heads, 63 sectors/track, 652 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: 0x3c8b5df6
Device
Boot Start End Blocks Id System
/dev/sdb1 1 652 5237158+ 5 Extended
Disk /dev/mapper/vg_qing-lv_root: 24.2 GB, 24234688512 bytes
255 heads, 63 sectors/track, 2946 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: 0x00000000
Disk /dev/mapper/vg_qing-lv_root doesn‘t contain a valid partition
table
Disk /dev/mapper/vg_qing-lv_swap: 2080 MB, 2080374784 bytes
255 heads, 63 sectors/track, 252 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: 0x00000000
Disk /dev/mapper/vg_qing-lv_swap doesn‘t contain a valid partition
table
2、开始创建逻辑分区
[root@qing init.d]# 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):
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (1-652, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-652, default
652):
Using default value 652
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@qing init.d]#
3、查看创建的逻辑分区
[root@qing init.d]# fdisk
-l
Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 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: 0x00062b86
Device
Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 3264 25701376 8e Linux LVM
Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 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: 0x3c8b5df6
Device
Boot Start End Blocks Id System
/dev/sdb1 1 652 5237158+ 5 Extended
/dev/sdb5 1 652 5237127 83 Linux
Disk /dev/mapper/vg_qing-lv_root: 24.2 GB, 24234688512 bytes
255 heads, 63 sectors/track, 2946 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: 0x00000000
Disk /dev/mapper/vg_qing-lv_root doesn‘t contain a valid partition
table
Disk /dev/mapper/vg_qing-lv_swap: 2080 MB, 2080374784 bytes
255 heads, 63 sectors/track, 252 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: 0x00000000
Disk /dev/mapper/vg_qing-lv_swap doesn‘t contain a valid partition
table
4、格式化分区
[root@qing init.d]# mkfs -t ext3 /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
327680 inodes, 1309281 blocks
65464 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1342177280
40 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
Writing inode tables:
done
Creati
本文出自 “小白的小窝” 博客,请务必保留此出处http://qing429.blog.51cto.com/5781009/1589353
标签:linux 分区
原文地址:http://qing429.blog.51cto.com/5781009/1589353