新建partition出现 device busy问题处理

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

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22907091/viewspace-748118/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22907091/viewspace-748118/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值