How to Format a Disk in BusyBox

Techwalla may earn compensation through affiliate links in this story. Learn more about our affiliate and product review process here.
Partition and format a hard disk in Linux with BusyBox.

Linux embedded systems and appliances usually do not have much physical data storage space or memory available, as such systems are designed for high availability with very few moving parts. The BusyBox application was designed to save space on embedded systems while still providing the essential command shell functionality needed for system administration. Adding an external hard disk drive to an embedded Linux appliance requires that the drive be formatted prior to use. Format an external hard disk drive using the functionality provided by BusyBox.

Advertisement

Step 1

Log in to the embedded Linux device using the user name and password of the root account or an account with administrator permissions.

Video of the Day

Step 2

Type "df -h" on the command line, and press "Enter." Note the name of the new hard drive listed under the "Filesystem" column. The new hard drive can be identified based upon the size of the drive listed in the output.

Advertisement

Step 3

Type "fdisk name_of_drive" on the command line, but replace "name_of_drive " with the name of the new hard drive noted earlier. Press "Enter." Type "mkfs.vfat –v name_of_drive size_of_drive," but replace "name_of_drive" with the name of the new hard drive noted earlier appended with the number "1," and replace "size_of_drive" with the size of the drive in "K" or kilobytes as displayed in the "df" command output. Press "Enter" to format the drive. The single partition on the drive will be formatted with the FAT32 file system.

Advertisement

Video of the Day

Advertisement

Advertisement

references