fdisk / sfdisk 未保存 USB 驱动器上的分区

fdisk / sfdisk 未保存 USB 驱动器上的分区

我的 USB 驱动器出现一些问题,无法正常工作,我尝试使用 fdisk 或 sfdisk 重新创建分区,但是我执行“-l”后却没有分区。

这是我运行 fdisk 的方式:

root:~$ sudo fdisk /dev/sdc

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sdc: 1020 MB, 1020887040 bytes
32 heads, 61 sectors/track, 1021 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1021, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1021, default 1021): 
Using default value 1021

Command (m for help): p

Disk /dev/sdc: 1020 MB, 1020887040 bytes
32 heads, 61 sectors/track, 1021 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1021      996465+  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

这是我运行 sfdisk 的方式:

root:~$ sudo sfdisk /dev/sdc
Checking that no-one is using this disk right now ...
OK

Disk /dev/sdc: 1021 cylinders, 32 heads, 61 sectors/track
Old situation:
Units = cylinders of 999424 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdc1          0       -       0          0    0  Empty
/dev/sdc2          0       -       0          0    0  Empty
/dev/sdc3          0       -       0          0    0  Empty
/dev/sdc4          0       -       0          0    0  Empty
Input in the following format; absent fields get a default value.
<start> <size> <type [E,S,L,X,hex]> <bootable [-,*]> <c,h,s> <c,h,s>
Usually you only need to specify <start> and <size> (and perhaps <type>).

/dev/sdc1 :
/dev/sdc1          0+   1020    1021-    996495+  83  Linux
/dev/sdc2 :
/dev/sdc2          0       -       0          0    0  Empty
/dev/sdc3 :
/dev/sdc3          0       -       0          0    0  Empty
/dev/sdc4 :
/dev/sdc4          0       -       0          0    0  Empty
New situation:
Units = cylinders of 999424 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdc1          0+   1020    1021-    996495+  83  Linux
/dev/sdc2          0       -       0          0    0  Empty
/dev/sdc3          0       -       0          0    0  Empty
/dev/sdc4          0       -       0          0    0  Empty
Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
Do you want to write this to disk? [ynq] y
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)

但是当我运行 fdisk -l /dev/sdc 时,我看到:

root:~$ fdisk -l /dev/sdc

Disk /dev/sdc: 1020 MB, 1020887040 bytes
32 heads, 61 sectors/track, 1021 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System

和 sfdisk -l /dev/sdc:

root:~$ sudo sfdisk -l /dev/sdc

Disk /dev/sdc: 1021 cylinders, 32 heads, 61 sectors/track
Units = cylinders of 999424 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdc1          0       -       0          0    0  Empty
/dev/sdc2          0       -       0          0    0  Empty
/dev/sdc3          0       -       0          0    0  Empty
/dev/sdc4          0       -       0          0    0  Empty

分区未保存。此外,这与我在尝试创建分区之前运行 -l 时得到的输出相同。

我也尝试过 parted、gparted 和其他在 Windows 上运行的应用程序。但都没有创建任何分区。

我正在使用 Ubuntu 10.04,并且已禁用自动挂载媒体。

有人知道为什么会发生这种情况吗?

答案1

您必须先将其设为“固定磁盘”,即使其像普通硬盘一样运行。winxp 说明: http://www.prime-expert.com/articles/a05/enabling-multiple-partitions-on-removable-usb-storage-devices.php

Linux 中也有类似的说明:

https://askubuntu.com/questions/101637/usb-turn-write-protection-off

相关内容