CentOS format USB flash drive

Source: Internet
Author: User
Generally, it is very easy to format a partitioned USB flash disk. you only need to use the mkfs command to specify the target file system. The example is as follows: $ fdisk-l $ mkfs-tvfat/dev/sdb112-t parameters are the target file format, other ext3, msdos and so on, the default is ext2. we can also use the following simple command to do this: mkdosfs (8 ),

Generally, it is very easy to format a partitioned USB flash disk. you only need to use the mkfs command to specify the target file system. The example is as follows:

$ fdisk -l$ mkfs -t vfat /dev/sdb1
  • 1
  • 2

The-t parameter is the target file format. the other parameters include ext3 and msdos. the default value is ext2. we can also use the following simple command to complete this task:

mkdosfs(8),  mke2fs(8),  mkfs.bfs(8),  mkfs.ext2(8),  mkfs.ext3(8),  mkfs.minix(8),  mkfs.msdos(8), mkfs.vfat(8),       mkfs.xfs(8), mkfs.xiafs(8)
  • 1
  • 2
  • 3

After using Linux tip 3 to make a USB flash drive into a system boot disk, the USB flash drive is actually divided into two partitions.

$ fdisk -l...Disk /dev/sdb: 4009 MB, 4009754624 bytes64 heads, 32 sectors/track, 3824 cylinders, total 7831552 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x7680fe3e   Device Boot      Start         End      Blocks   Id  System/dev/sdb1   *           0     2611199     1305600   17  Hidden HPFS/NTFSDisk /dev/sdb1: 1336 MB, 1336934400 bytes64 heads, 32 sectors/track, 1275 cylinders, total 2611200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x7680fe3e     Device Boot      Start         End      Blocks   Id  System/dev/sdb1p1   *           0     2611199     1305600   17  Hidden HPFS/NTFS
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22

This will hide a large part of the space. it is not enough to format/dev/sdb1 only. Also format/dev/sdb so that the entire USB flash disk is formatted. However, there will be a problem:

$ mkfs -t vfat /dev/sdbmkfs.vfat 3.0.9 (31 Jan 2010)mkfs.vfat: Device partition expected, not making filesystem on entire device '/dev/sdb' (use -I to override)
  • 1
  • 2
  • 3
  • 4

Follow the prompts to add the-I parameter:

$ mkfs.vfat -I /dev/sdbmkfs.vfat 3.0.9 (31 Jan 2010)
  • 1
  • 2

Re-insert the USB flash disk, and the whole USB disk space is back.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.