如何将 1GB U 盘格式化为 512 字节扇区的 FAT32?

如何将 1GB U 盘格式化为 512 字节扇区的 FAT32?

我正在努力格式化一个 1GB USB 记忆棒,以便我可以用它来安装新的 Linux 操作系统。因为磁盘实用程序在创建文件系统时失败了。我尝试fdisk通过以下步骤手动创建主引导记录和 1GB 分区:

# fdisk /dev/sdc

Command (m for help): p
Disk /dev/sdc: 994.5 MiB, 1042808832 bytes, 509184 sectors
Units: sectors of 1 * 2048 = 2048 bytes
Sector size (logical/physical): 2048 bytes / 2048 bytes
I/O size (minimum/optimal): 2048 bytes / 2048 bytes
Disklabel type: dos
Disk identifier: 0x967a68db

Device    Boot Start       End  Blocks  Id System
/dev/sdc1 *        1    509183 1018366   b W95 FAT32

Command (m for help): o

Created a new DOS disklabel with disk identifier 0x727b4976.

Command (m for help): n

Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (512-509183, default 512): 
Last sector, +sectors or +size{K,M,G,T,P} (512-509183, default 509183): 

Created a new partition 1 of type 'Linux' and of size 993.5 MiB.

Command (m for help): v
Partition 1: cylinder 253 greater than maximum 252
Partition 1: previous sectors 509183 disagrees with total 507835
Remaining 511 unallocated 2048-byte sectors.

Command (m for help): w

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

然后我尝试将其格式化为扇区大小为 512 字节的 FAT32 文件系统,但它说允许的最小值为 2048 字节。

# mkfs.fat -v -F 32 -S 512 /dev/sdc1
mkfs.fat 3.0.26 (2014-03-07)
Warning: sector size was set to 2048 (minimal for this device)
WARNING: Not enough clusters for a 32 bit FAT!
/dev/sdc1 has 33 heads and 61 sectors per track,
hidden sectors 0x0800;
logical sector size is 2048,
using 0xf8 media descriptor, with 508672 sectors;
drive number 0x80;
filesystem has 2 32-bit FATs and 8 sectors per cluster.
FAT size is 125 sectors, and provides 63548 clusters.
There are 32 reserved sectors.
Volume ID is 1ab3abc1, no volume label.

我需要 512 字节扇区,因为syslinux不支持更大的扇区大小。

答案1

为了:

警告:没有足够的簇用于 32 位 FAT!

您可以在 mkfs.fat 命令中使用 -s2 参数。

另一方面

if (sector_size_set)
{
  if (ioctl(dev, BLKSSZGET, &min_sector_size) >= 0)
      if (sector_size < min_sector_size)
        {
      sector_size = min_sector_size;
          fprintf(stderr, "Warning: sector size was set to %d (minimal for this device)\n", sector_size);
        }
}

是给出第一个警告的代码片段。如所见,如果设置了扇区大小,它将获得设备的最小逻辑扇区大小,如果给定的扇区大小低于最小扇区大小,则会发出警告,并将最小扇区大小指定为扇区大小。

答案2

好的,所以在计算机科学中,我不太喜欢说“你无法从这里到达那里”,但在这种情况下,您正在尝试将方钉装入圆孔中。

扇区大小为通常由设定的设备。报告的 2048B 扇区大小为普通的对于 CD/DVD 驱动器,而 512B(或 520B——这就是为什么我说通常——一些硬盘驱动器实际上可以在 512 和 520 之间切换)。

当你跑的时候磁盘驱动器,它清楚地表明媒体部门的规模是2048B。你不能容易地改变它,并且很可能,你无法改变它时期。您可以尝试联系 USB 驱动器的制造商,看看是否有可用于重置该设备上的扇区大小的工具...或者您可以开车去商店(沃尔玛?塔吉特?史泰博?您能想到的!)并花费5 到 10 美元购买一个新的 USB 记忆棒。

相关内容