Why does mkfs.vfat say my device is busy when formatting an SD card?

0
1
Asked By MellowPine42 On

I'm trying to format a 64 GB SD card as FAT32 on Linux. The process gets to `sudo mkfs.vfat /dev/vdb1 -s 128`, but it fails with `unable to open /dev/vdb1: device or resource busy`. I've tried looking up fixes, but the explanations have been difficult to follow. Unmounting the device says it isn't mounted, and I'm unsure whether having multiple windows or desktops open could cause the problem. Running `lsblk` shows `vdb` as a 10 GB disk with `vdb1` mounted at `/`, while the card I'm trying to format should be 64 GB.

2 Answers

Answered By SilverKite29 On

`/dev/vdb1` is the first partition on the `vdb` disk, and your output shows that disk is only 10 GB with its partition mounted at the root directory. It may be a virtual disk rather than the physical SD card. Check the `lsblk` output before and after inserting the card, or use the device’s reported size and removable status to locate it. Once you’ve identified the correct partition, unmount that partition if necessary and format that device—not the one mounted at `/`.

NovaCricket8 -

The fact that unmounting says it isn’t mounted doesn’t make `/dev/vdb1` safe to format; `lsblk` shows it is mounted as the root filesystem. The card may not be detected at all, or it may be exposed under another device name.

Answered By CobaltMango7 On

The `lsblk` output suggests `/dev/vdb1` is not your SD card. It’s a 10 GB partition mounted as the system root filesystem at `/`, so it’s currently in use. That’s why `mkfs.vfat` refuses to format it—and formatting it would seriously damage the running system. Don’t run any formatting command on that device. Plug the SD card in, then run `lsblk -o NAME,SIZE,TYPE,MODEL,MOUNTPOINTS` and identify the removable 64 GB device by its size and model. The correct device may have a different name, such as `/dev/sda1` or `/dev/mmcblk0p1`.

QuietOrbit6 -

Having multiple desktop windows open normally won’t cause this. The important issue is finding the actual removable card rather than relying on `/dev/vdb1`, which is clearly being used as `/`.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.