Chinaunix首页 | 论坛 | 博客
  • 博客访问: 372213
  • 博文数量: 113
  • 博客积分: 3035
  • 博客等级: 中校
  • 技术积分: 1430
  • 用 户 组: 普通用户
  • 注册时间: 2006-11-01 16:32
文章分类
文章存档

2011年(42)

2010年(70)

2009年(1)

我的朋友

分类: LINUX

2010-12-15 16:31:44

1.fdisk新建一个新的partition,由于已经存在了sda6,我们先删除它再新建

[root@cent initrd]# fdisk /dev/sda

 

The number of cylinders for this disk is set to 2610.

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)

 

Command (m for help): m

Command action

   a   toggle a bootable flag

   b   edit bsd disklabel

   c   toggle the dos compatibility flag

   d   delete a partition

   l   list known partition types

   m   print this menu

   n   add a new partition

   o   create a new empty DOS partition table

   p   print the partition table

   q   quit without saving changes

   s   create a new empty Sun disklabel

   t   change a partition's system id

   u   change display/entry units

   v   verify the partition table

   w   write table to disk and exit

   x   extra functionality (experts only)

 

Command (m for help): p

 

Disk /dev/sda: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          25      200781   83  Linux

/dev/sda2              26        1682    13309852+  83  Linux

/dev/sda3            1683        2064     3068415   83  Linux

/dev/sda4            2065        2610     4385745    5  Extended

/dev/sda5            2065        2102      305203+  82  Linux swap / Solaris

/dev/sda6            2103        2107       40131   83  Linux

 

Command (m for help): d

Partition number (1-6): 6

 

Command (m for help): p

 

Disk /dev/sda: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          25      200781   83  Linux

/dev/sda2              26        1682    13309852+  83  Linux

/dev/sda3            1683        2064     3068415   83  Linux

/dev/sda4            2065        2610     4385745    5  Extended

/dev/sda5            2065        2102      305203+  82  Linux swap / Solaris

 

Command (m for help): n

First cylinder (2103-2610, default 2103):

Using default value 2103

Last cylinder or +size or +sizeM or +sizeK (2103-2610, default 2610): +30M

 

Command (m for help): p

 

Disk /dev/sda: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          25      200781   83  Linux

/dev/sda2              26        1682    13309852+  83  Linux

/dev/sda3            1683        2064     3068415   83  Linux

/dev/sda4            2065        2610     4385745    5  Extended

/dev/sda5            2065        2102      305203+  82  Linux swap / Solaris

/dev/sda6            2103        2107       40131   83  Linux

 

2.使用w写入分区信息

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

 

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

3.为了不reboot就能生效,强制内核重新读取分区表

[root@cent initrd]# partprobe

4.格式化成为ext3格式

[root@cent initrd]# mkfs -t ext3 /dev/sda6

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=1024 (log=0)

Fragment size=1024 (log=0)

10040 inodes, 40128 blocks

2006 blocks (5.00%) reserved for the super user

First data block=1

Maximum filesystem blocks=41156608

5 block groups

8192 blocks per group, 8192 fragments per group

2008 inodes per group

Superblock backups stored on blocks:

        8193, 24577

 

Writing inode tables: done                          

Creating journal (4096 blocks): done

Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 39 mounts or

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

5.执行磁盘检查

[root@cent initrd]# fsck -C -t ext3 /dev/sda6

fsck 1.39 (29-May-2006)

e2fsck 1.39 (29-May-2006)

/dev/sda6: clean, 11/10040 files, 5868/40128 blocks

6.挂载分区

[root@cent initrd]# mount  /dev/sda6 /mnt

[root@cent initrd]# df -m

Filesystem           1M-blocks      Used Available Use% Mounted on

/dev/sda2                12591      3679      8263  31% /

/dev/sda3                 2903       239      2515   9% /home

/dev/sda1                  190        12       169   7% /boot

tmpfs                      506         0       506   0% /dev/shm

/dev/sda6                   38         5        32  13% /mnt

阅读(8366) | 评论(1) | 转发(1) |
给主人留下些什么吧!~~

chinaunix网友2010-12-16 14:48:03

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com