Problemet
Estava criando um pendrive “botável” com Debian, conforme Post “Pendrive de boot com Debian Lenny customizado“, quando tive um erro ao executar a formatação utilizando “Mkfs”:
rot@Debian:/home/Matrix# mkfs.ext2 /dev/sdb1 mke2fs 1.42.5 (29-Jul-2012) Could not stat /dev/sdb1 --- Arquivo ou diretório não encontrado The device apparently does not exist; did you specify it correctly? |
Faktum är, o problema parece ser um reflexo da etapa anterior, quando eu ainda estava criando a partição “sdb1” Med “Fdisk” e apareceu um “WARNING” ao mandar gravar (w):
rot@Debian:/home/Matrix# fdisk /dev/sdb ... Kommandot (m Vara 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…
Lösning
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” Igen:
rot@Debian:/home/Matrix# mkfs.ext2 /dev/sdb1 mke2fs 1.42.5 (29-Jul-2012) Filesystem label= OS type: Linux Block size=4096 (Logga in=2) Fragment size=4096 (Logga in=2) Stride=0 blocks, Stripe width=0 blocks 122160 inodes, 487707 blocks 24385 blocks (5.00%) reserved Vara 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 |
Nu Ja! Veja que o filesystem ext2 foi criado:
rot@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) |
Apenas para ficar registrado, vi um comentário referente ao mesmo problema, em que uma pessoa disse ter feito o o seguinte procedimento solucionar:
rot@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 |
rot@Debian:/home/Matrix# mknod /dev/sdb1 b 8 16 |
Para mim não precisou fazer isto; foi só mesmo reiniciar… fica a dica!
Teckensnitt
– Pendrive de boot com Debian Lenny customizado
– mkfs => Could not stat /dev/sdb1, although partition exists