Extended partitions in Linux format

Source: Internet
Author: User

Extended partitions in Linux format

If you encounter the following error when formatting a disk in Linux, it indicates that you are formatting an extended partition.

[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).
 

You cannot directly format extended partitions. You can only format primary partitions and logical partitions. Then how should we format an extended partition? We can either delete the extended partition, create a primary partition, or create a logical partition on the extended partition, as shown in the following operations:

1: Create a logical Partition

[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: Format logical partitions

[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: Write the mounting information to the configuration file.

Edit [root @ GETTestLNX06 ~] # Vi/etc/fstab

4: mount the new partition

[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 /]# 

[References]:

Http://www.docin.com/p-670819195.html

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.