Correcting “Could not stat/dev/sdb1” to format pendrive with “mkfs”

To mount a USB key with boot Debian, did the partitioning (Fdisk) and formatting (mkfs), but I ended up having problems (by not reading the command prompt).

Problem

Was creating a pendrive “botável” with Debian, as Post Boot Flash with Debian Lenny customized, When I had an error executing formatting using “mkfs”:

  root@Debian:/Home/matrix# mkfs.ext2/dev/sdb1
  mke2fs 1.42.5 (29-Jul-2012)
  Could not STAT /dev/sdb1 --- File or directory not found The device apparently does not exist; did you specify it correctly?

Actually, the problem seems to be a reflection of the previous step, When I was creating the partition “sdb1” with “Fdisk” and there was a “WARNING” to send record (w):

  root@Debian:/Home/matrix# Fdisk/dev/sdb
  ...
  Command (m is help): w
  The partition table has been altered!
  Calling ioctl() to re-read partition table.
  WARNING: Re-reading the partition table failed with error 22: Invalid argument.
  The kernel still uses the old table.
  The new table will be used at the next reboot.
  Syncing disks.

O aviso acima (WARNING) já dizia tudo; bastava ter lido…

Solution

Para conseguir formatar, foi só fazer o que dizia a mensagem: “The new table will be used at the next reboot”, IE, reiniciar o Debian e só depois usar o “mkfs” novamente:

  root@Debian:/Home/matrix# mkfs.ext2/dev/sdb1
  mke2fs 1.42.5 (29-Jul-2012)
  Filesystem label=   OS type: Linux   Block size=4096 (log=2)
  Fragment size=4096 (log=2)
  Stride=0 blocks, Stripe width=0 blocks
  122160 inodes, 487707 blocks
  24385 blocks (5.00%) reserved is the super user   First data block=0
  Maximum filesystem blocks=503316480
  15 block groups
  32768 blocks per group, 32768 fragments per group
  8144 inodes per group   Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912
 
  Allocating group tables: done                            
  Writing inode tables: done                            
  Writing superblocks and filesystem accounting information: done

Now yes! See the ext2 filesystem was created:

  root@Debian:/Home/matrix# file-s/dev/sdb1
  /dev/sdb1: Sticky Linux Rev 1.0 ext2 filesystem data, UUID= 85d9e0b5-e251-48ca-a368-51a557eb1570 (large files)

Just for the record, I saw a comment regarding the same problem, in which a person is said to have done the following steps troubleshoot:

root@Debian:/Home/matrix# cat/proc/partitions 
major minor  #blocks name
 
   8        0   26214400 SDA
   8        1     975872 sda1
   8        2   25236480 sda2
  11        0    1048575 sr0
   8       16    1951632 SDB
  root@Debian:/Home/matrix# mknod/dev/sdb1 b 8 16

To me he didn't have to do this; was only restart… the hint!

Fonts

Boot Flash with Debian Lenny customized
mkfs = > Could not stat/dev/sdb1, Although partition exists

Total hits: 3844

Leave a reply

The your email address will not be published. Required fields are marked with *