Linux 格式化分區 報錯Could not stat --- No such file or directory 和 partprobe 命令

來源:互聯網
上載者:User

標籤:des   style   c   tar   ext   color   

分區的過程正常:[[email protected] /]#  fdisk -l Disk /dev/sda: 21.4 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes    Device Boot      Start         End      Blocks   Id  System/dev/sda1   *           1          13      104391   83  Linux/dev/sda2              14         650     5116702+  83  Linux/dev/sda3             651         841     1534207+  82  Linux swap / Solaris [[email protected] /]# 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):  nCommand action   e   extended   p   primary partition (1-4) pSelected partition 4First cylinder (842-2610, default 842):Using default value 842Last cylinder or +size or +sizeM or +sizeK (842-2610, default 2610):Using default value 2610 Command (m for help):  wThe 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.  再次查看,分區已經劃好:[[email protected] /]#  fdisk -l Disk /dev/sda: 21.4 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes    Device Boot      Start         End      Blocks   Id  System/dev/sda1   *           1          13      104391   83  Linux/dev/sda2              14         650     5116702+  83  Linux/dev/sda3             651         841     1534207+  82  Linux swap / Solaris/dev/sda4             842        2610    14209492+  83  Linux  但是格式化的時候,報錯:[[email protected] /]#  mkfs -t ext3 /dev/sda4mke2fs 1.39 (29-May-2006)Could not stat /dev/sda4 --- No such file or directory The device apparently does not exist; did you specify it correctly?  解決方案:執行下partprobe 命令        partprobe包含在parted的rpm軟體包中。partprobe可以修改kernel中分區表,使kernel重新讀取分區表。 因此,使用該命令就可以建立分區並且在不重新啟動機器的情況下系統能夠識別這些分區。 查看是否安裝該命令:[[email protected] dev]# rpm -q partedparted-1.8.1-23.el5 我們執行一下該命令:[[email protected] dev]# partprobeWarning: Unable to open /dev/hdc read-write (Read-only file system).  /dev/hdc has been opened read-only.  然後在格式化,就ok了:[[email protected] dev]# mkfs -t ext3 /dev/sda4mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)1778880 inodes, 3552373 blocks177618 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=3640655872109 block groups32768 blocks per group, 32768 fragments per group16320 inodes per groupSuperblock backups stored on blocks:        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208 Writing inode tables: done                           Creating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done This filesystem will be automatically checked every 38 mounts or180 days, whichever comes first.  Use tune2fs -c or -i to override.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.