Linux Disk partitioning

Source: Internet
Author: User

To create an extended partition:
[Email protected] init.d]# Fdisk/dev/sdb

Warning:dos-compatible mode is deprecated. It ' s stronglyrecommended 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, Sectors/track, 652 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk Identifier:0x3c8b5df6

Deviceboot 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, default652):
Using Default value 652

Command (M for help): P

disk/dev/sdb:5368 MB, 5368709120 bytes
255 heads, Sectors/track, 652 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk Identifier:0x3c8b5df6

Deviceboot 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.
[Email protected] init.d]#

formatting:
Problem, the extended partition cannot be formatted and needs to be formatted after the logical partition is created
[Email protected] init.d]# mkfs-t EXT3/DEV/SDB1
MKE2FS 1.41.12 (17-may-2010)
Mkfs.ext3:inode_size (+) * Inodes_count (0) too big for a
FileSystem with 0 blocks, specify higher inode_ratio (-i)
or lower inode count (-N).

[Email protected] init.d]#

To create a logical partition:
1. View partition information
[Email protected] init.d]# fdisk-l

disk/dev/sda:26.8 GB, 26843545600 bytes
255 heads, Sectors/track, 3263 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00062b86

Deviceboot Start End Blocks Id System
/DEV/SDA1 * 1 512000 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 3264 25701376 8e Linux LVM

Disk/dev/sdb: 5368 mb,5368709120 bytes
255 heads, Sectors/track, 652 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk Identifier:0x3c8b5df6

Deviceboot Start End Blocks Id System
/DEV/SDB11 652 5237158+ 5 Extended

disk/dev/mapper/vg_qing-lv_root:24.2 GB, 24234688512 bytes
255 heads, Sectors/track, 2946 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

Disk/dev/mapper/vg_qing-lv_root doesn ' t contain a valid partitiontable

disk/dev/mapper/vg_qing-lv_swap:2080 MB, 2080374784 bytes
255 heads, Sectors/track, 252 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

Disk/dev/mapper/vg_qing-lv_swap doesn ' t contain a valid partitiontable
2. Start creating logical Partitions
[Email protected] init.d]# Fdisk/dev/sdb

Warning:dos-compatible mode is deprecated. It ' s stronglyrecommended 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, default652):
Using Default value 652

Command (M for help): W
The partition table has been altered!

Calling IOCTL () to re-read partition table.
Syncing disks.
[Email protected] init.d]#
3. View the logical partitions created
[Email protected] init.d]# fdisk-l

disk/dev/sda:26.8 GB, 26843545600 bytes
255 heads, Sectors/track, 3263 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00062b86

Deviceboot Start End Blocks Id System
/DEV/SDA1 * 1 512000 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 3264 25701376 8e Linux LVM

disk/dev/sdb:5368 MB, 5368709120 bytes
255 heads, Sectors/track, 652 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk Identifier:0x3c8b5df6

Deviceboot Start End Blocks Id System
/DEV/SDB1 1 652 5237158+ 5 Extended
/DEV/SDB51 652 5237127 Linux

disk/dev/mapper/vg_qing-lv_root:24.2 GB, 24234688512 bytes
255 heads, Sectors/track, 2946 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

Disk/dev/mapper/vg_qing-lv_root doesn ' t contain a valid partitiontable

disk/dev/mapper/vg_qing-lv_swap:2080 MB, 2080374784 bytes
255 heads, Sectors/track, 252 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

Disk/dev/mapper/vg_qing-lv_swap doesn ' t contain a valid partitiontable
4. Format the partition
[Email protected] 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
Groups block
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


This article is from the "small White Nest" blog, please be sure to keep this source http://qing429.blog.51cto.com/5781009/1589353

Linux Disk partitioning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.