zzz同学修复U盘的记录

来源:互联网 发布:ubuntu安装 闪下划线 编辑:程序博客网 时间:2024/04/27 13:49
root's password:
linux-mrph:~ # dd if=/dev/zero of=/dev/sdb bs=1024count=10
10+0 records in
10+0 records out
10240 bytes (10 kB) copied, 0.00486736 s, 2.1 MB/s
linux-mrph:~ # mkfs.vfat /dev/sdb 
mkfs.vfat 3.0.10 (12 Sep 2010)
mkfs.vfat: Device partition expected, not making filesystem onentire device '/dev/sdb' (use -I to override)
linux-mrph:~ # fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun,SGI or OSF disklabel
Building a new DOS disklabel with disk identifier0xaef21059.
Changes will remain in memory only, until you decide to writethem.
After that, of course, the previous content won't berecoverable.

Warning: invalid flag 0x0000 of partition table 4 will becorrected by w(rite)

Command (m for help): m
Command action
   a  toggle a bootable flag
   b   editbsd disklabel
   c  toggle the dos compatibility flag
   d  delete a partition
   l   listknown partition types
   m  print this menu
   n   adda new partition
   o  create a new empty DOS partition table
   p  print the partition table
   q   quitwithout saving changes
   s  create a new empty Sun disklabel
   t  change a partition's system id
   u  change display/entry units
   v  verify the partition table
   w  write table to disk and exit
   x  extra functionality (experts only)

Command (m for help): n
Command action
   e  extended
   p  primary partition (1-4)
p
Partition number (1-4, default 1): 
Using default value 1
First sector (2048-16383, default2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-16383, default16383): 
Using default value 16383

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

Calling ioctl() to re-read partition table.
Syncing disks.
linux-mrph:~ # mkfs.vfat /dev/sdb 
mkfs.vfat 3.0.10 (12 Sep 2010)
mkfs.vfat: Device partition expected, not making filesystem onentire device '/dev/sdb' (use -I to override)
linux-mrph:~ # mkfs.vfat  --help
mkfs.vfat 3.0.10 (12 Sep 2010)
mkfs.vfat: invalid option -- '-'
Unknown option: ?
Usage: mkdosfs [-a][-A][-c][-C][-v][-I][-l bad-block-file][-bbackup-boot-sector]
      [-m boot-msg-file][-n volume-name][-ivolume-id]
      [-s sectors-per-cluster][-Slogical-sector-size][-f number-of-FATs]
      [-h hidden-sectors][-F fat-size][-rroot-dir-entries][-R reserved-sectors]
      /dev/name [blocks]
linux-mrph:~ # mkfs.vfat  -n 'vo' /dev/sdb-I
mkfs.vfat 3.0.10 (12 Sep 2010)
linux-mrph:~ # dd if=/dev/zero of=/dev/sdb bs=1024count=1024*10
dd: invalid number `1024*10'
linux-mrph:~ # dd if=/dev/zero of=/dev/sdb bs=1024count=10240
dd: writing `/dev/sdb': No space left on device
8193+0 records in
8192+0 records out
8388608 bytes (8.4 MB) copied, 3.55435 s, 2.4 MB/s
linux-mrph:~ # dd if=/dev/zero of=/dev/sdb bs=1024count=102400
102400+0 records in
102400+0 records out
104857600 bytes (105 MB) copied, 0.228272 s, 459 MB/s
linux-mrph:~ # fdisk /dev/sdb 
Device contains neither a valid DOS partition table, nor Sun,SGI or OSF disklabel
Building a new DOS disklabel with disk identifier0x18fe40aa.
Changes will remain in memory only, until you decide to writethem.
After that, of course, the previous content won't berecoverable.

Warning: invalid flag 0x0000 of partition table 4 will becorrected by w(rite)

Command (m for help): n
Command action
   e  extended
   p  primary partition (1-4)
p
Partition number (1-4, default 1): 
Using default value 1
First sector (2048-204799, default2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-204799, default204799): 
Using default value 204799

Command (m for help): m
Command action
   a  toggle a bootable flag
   b   editbsd disklabel
   c  toggle the dos compatibility flag
   d  delete a partition
   l   listknown partition types
   m  print this menu
   n   adda new partition
   o  create a new empty DOS partition table
   p  print the partition table
   q   quitwithout saving changes
   s  create a new empty Sun disklabel
   t  change a partition's system id
   u  change display/entry units
   v  verify the partition table
   w  write table to disk and exit
   x  extra functionality (experts only)

Command (m for help): p

Disk /dev/sdb: 104 MB, 104857600 bytes
255 heads, 63 sectors/track, 12 cylinders, total 204800sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x18fe40aa

   Device Boot     Start       End     Blocks   Id System
/dev/sdb1          2048     204799     101376   83 Linux

Command (m for help): d
Selected partition 1

Command (m for help): 
Command (m for help): n
Command action
   e  extended
   p  primary partition (1-4)
p
Partition number (1-4, default 1): 
Using default value 1
First sector (2048-204799, default2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-204799, default204799): 
Using default value 204799

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

Syncing disks.
linux-mrph:~ # mkfs.ext4 --help
mkfs.ext4: invalid option -- '-'
Usage: mkfs.ext4 [-c|-l filename] [-b block-size] [-ffragment-size]
[-i bytes-per-inode] [-I inode-size] [-Jjournal-options]
[-G meta group size] [-N number-of-inodes]
[-m reserved-blocks-percentage] [-o creator-os]
[-g blocks-per-group] [-L volume-label] [-Mlast-mounted-directory]
[-O feature[,...]] [-r fs-revision] [-Eextended-option[,...]]
[-T fs-type] [-U UUID] [-jnqvFKSV] device [blocks-count]
linux-mrph:~ # mkfs.vfat -n 'boot' /dev/sd
sda   sda1  sda4 sda5  sda6 sda7  sdb  
linux-mrph:~ # mkfs.vfat -n 'boot' /dev/sd
sda   sda1  sda4 sda5  sda6 sda7  sdb  
linux-mrph:~ # mkfs.vfat -n 'boot'/dev/sdb 
.bash_history       .gconfd/           .viminfo
.dbus/             .gnupg/            bin/
.emacs.d/          .kbd/             inst-sys/
.exrc              .pki/             
.gconf/            .recently-used.xbel 
linux-mrph:~ # mkfs.vfat -n 'boot'/dev/sdb 
mkfs.vfat 3.0.10 (12 Sep 2010)
linux-mrph:~ # 
linux-mrph:~ # 
linux-mrph:~ # mount /dev/sdb /mnt
linux-mrph:~ # 
linux-mrph:~ # 
linux-mrph:~ # ls /mnt
linux-mrph:~ # cd /mnt
linux-mrph:/mnt # du -sh .
16K .
linux-mrph:/mnt # cd ..
linux-mrph:/ # ls
bin   configure  etc  lib        media  opt  root  selinux sys  usr
boot  dev       home lost+found  mnt   proc  sbin srv     tmp  var
linux-mrph:/ # cd /mnt/
linux-mrph:/mnt # echo hello > t.txt
linux-mrph:/mnt # cd ..
linux-mrph:/ # umount /mnt
linux-mrph:/ # umount /mnt/
umount: /mnt/: not mounted
linux-mrph:/ # umount /media/UNTITLED/
linux-mrph:/ # ls
bin   configure  etc  lib        media  opt  root  selinux sys  usr
boot  dev       home lost+found  mnt   proc  sbin srv     tmp  var
linux-mrph:/ # fdisk /dev/sd
sda   sda1  sda4 sda5  sda6 sda7  sdb  sdb1  
linux-mrph:/ # fdisk /dev/sd
sda   sda1  sda4 sda5  sda6 sda7  sdb  sdb1  
linux-mrph:/ # fdisk /dev/sdb

Command (m for help): p

Disk /dev/sdb: 4098 MB, 4098883584 bytes
2 heads, 63 sectors/track, 63536 cylinders, total 8005632sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x01241986

   Device Boot     Start       End     Blocks   Id System
/dev/sdb1   *        64     8005631    4002784   b  W95 FAT32

Command (m for help): d
Selected partition 1

Command (m for help): 
Command (m for help): 
Command (m for help): n
Command action
   e  extended
   p  primary partition (1-4)
p
Partition number (1-4, default 1): 
Using default value 1
First sector (2048-8005631, default2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-8005631, default8005631): 
Using default value 8005631

Command (m for help): p

Disk /dev/sdb: 4098 MB, 4098883584 bytes
2 heads, 63 sectors/track, 63536 cylinders, total 8005632sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x01241986

   Device Boot     Start       End     Blocks   Id System
/dev/sdb1          2048    8005631     4001792  83  Linux

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/sdb: 4098 MB, 4098883584 bytes
2 heads, 63 sectors/track, 63536 cylinders, total 8005632sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x01241986

   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, default 1): 1
First sector (2048-8005631, default 2048): 1
Value out of range.
First sector (2048-8005631, default 2048): 1
Value out of range.
First sector (2048-8005631, default 2048):       
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-8005631, default8005631): 
Using default value 8005631

Command (m for help): x

Expert command (m for help): p

Disk /dev/sdb: 2 heads, 63 sectors, 63536 cylinders

Nr AF  Hd Sec  Cyl Hd Sec  Cyl    Start     Size ID
 1 00  33   16  33   48      2048   8003584 83
 2 00   0  0    0   0           0        0 00
 3 00   0  0    0   0           0        0 00
 4 00   0  0    0   0           0        0 00

Expert command (m for help): m
Command action
   b   movebeginning of data in a partition
   c  change number of cylinders
   d  print the raw data in the partition table
   e   listextended partitions
   f   fixpartition order
   g  create an IRIX (SGI) partition table
   h  change number of heads
   i  change the disk identifier
   m  print this menu
   p  print the partition table
   q   quitwithout saving changes
   r  return to main menu
   s  change number of sectors/track
   v  verify the partition table
   w  write table to disk and exit

Expert command (m for help): c
Number of cylinders (1-1048576, default63536): 
Using default value 63536

Expert command (m for help): b
Partition number (1-4): 1
New beginning of data (1-8005631, default 2048): 1

Expert command (m for help): s
Number of sectors (1-63, default 63): 
Using default value 63

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

Calling ioctl() to re-read partition table.
Syncing disks.
linux-mrph:/ # 
linux-mrph:/ # fdisk /dev/sd
sda   sda1  sda4 sda5  sda6 sda7  sdb  sdb1  
linux-mrph:/ # fdisk /dev/sd
sda   sda1  sda4 sda5  sda6 sda7  sdb  sdb1  
linux-mrph:/ # fdisk /dev/sdb

Command (m for help): p

Disk /dev/sdb: 4098 MB, 4098883584 bytes
2 heads, 33 sectors/track, 121297 cylinders, total 8005632sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x01241986

   Device Boot     Start       End     Blocks   Id System
/dev/sdb1             1    8005631    4002815+  83  Linux

Command (m for help): d
Selected partition 1

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

Calling ioctl() to re-read partition table.
Syncing disks.
linux-mrph:/ # 
linux-mrph:/ # 
linux-mrph:/ # fdisk /dev/sdb 

Command (m for help): p\

Disk /dev/sdb: 4098 MB, 4098883584 bytes
127 heads, 62 sectors/track, 1016 cylinders, total 8005632sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x01241986

   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, default 1): 
Using default value 1
First sector (2048-8005631, default 2048): ^C
linux-mrph:/ # 
linux-mrph:/ # 
linux-mrph:/ # dd if=/dev/zero of=/dev/
Display all 207 possibilities? (y or n)
linux-mrph:/ # dd if=/dev/zero of=/dev/sdb count=40480bs=40480
40480+0 records in
40480+0 records out
1638630400 bytes (1.6 GB) copied, 486.109 s, 3.4 MB/s
linux-mrph:/ # fdisk /dev/sdb 
Device contains neither a valid DOS partition table, nor Sun,SGI or OSF disklabel
Building a new DOS disklabel with disk identifier0x17cd5cb2.
Changes will remain in memory only, until you decide to writethem.
After that, of course, the previous content won't berecoverable.

Warning: invalid flag 0x0000 of partition table 4 will becorrected by w(rite)

Command (m for help): p

Disk /dev/sdb: 4098 MB, 4098883584 bytes
127 heads, 62 sectors/track, 1016 cylinders, total 8005632sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x17cd5cb2

   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, default 1): 
Using default value 1
First sector (2048-8005631, default2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-8005631, default8005631): 
Using default value 8005631

Command (m for help): d
Selected partition 1

Command (m for help): x

Expert command (m for help): m
Command action
   b   movebeginning of data in a partition
   c  change number of cylinders
   d  print the raw data in the partition table
   e   listextended partitions
   f   fixpartition order
   g  create an IRIX (SGI) partition table
   h  change number of heads
   i  change the disk identifier
   m  print this menu
   p  print the partition table
   q   quitwithout saving changes
   r  return to main menu
   s  change number of sectors/track
   v  verify the partition table
   w  write table to disk and exit

Expert command (m for help): p

Disk /dev/sdb: 127 heads, 62 sectors, 1016 cylinders

Nr AF  Hd Sec  Cyl Hd Sec  Cyl    Start     Size ID
 1 00   0  0    0   0           0        0 00
 2 00   0  0    0   0           0        0 00
 3 00   0  0    0   0           0        0 00
 4 00   0  0    0   0           0        0 00

Expert command (m for help): f
Nothing to do. Ordering is correct already.


Expert command (m for help): b
Partition number (1-4): 1
Partition 1 has no data area

Expert command (m for help): c
Number of cylinders (1-1048576, default1016): 
Using default value 1016

Expert command (m for help): s
Number of sectors (1-63, default 62): 
Using default value 62

Expert command (m for help): b
Partition number (1-4): 1
Partition 1 has no data area

Expert command (m for help): r

Command (m for help): m
Command action
   a  toggle a bootable flag
   b   editbsd disklabel
   c  toggle the dos compatibility flag
   d  delete a partition
   l   listknown partition types
   m  print this menu
   n   adda new partition
   o  create a new empty DOS partition table
   p  print the partition table
   q   quitwithout saving changes
   s  create a new empty Sun disklabel
   t  change a partition's system id
   u  change display/entry units
   v  verify the partition table
   w  write table to disk and exit
   x  extra functionality (experts only)

Command (m for help): o
Building a new DOS disklabel with disk identifier0x6e71279b.
Changes will remain in memory only, until you decide to writethem.
After that, of course, the previous content won't berecoverable.

Warning: invalid flag 0x0000 of partition table 4 will becorrected by w(rite)

Command (m for help): l

 0  Empty         24  NEC DOS        81 Minix / old Lin bf  Solaris      
 1  FAT12         27  Hidden NTFS Win 82 Linux swap / So c1  DRDOS/sec(FAT-
 2  XENIX root     39 Plan 9         83 Linux          c4 DRDOS/sec (FAT-
 3  XENIX usr      3c PartitionMagic  84 OS/2 hidden C:  c6 DRDOS/sec (FAT-
 4  FAT16<32M     40  Venix 80286    85  Linuxextended  c7  Syrinx       
 5  Extended      41  PPC PReP Boot  86  NTFS volume set da Non-FS data   
 6  FAT16         42  SFS           87  NTFSvolume set db  CP/M / CTOS / .
 7  HPFS/NTFS/exFAT 4d QNX4.x         88 Linux plaintext de  Dell Utility  
 8  AIX           4e  QNX4.x2nd part 8e  Linux LVM      df  BootIt       
 9  AIX bootable   4f  QNX4.x3rd part 93  Amoeba        e1  DOS access    
 a  OS/2 Boot Manag 50 OnTrack DM     94  Amoeba BBT     e3 DOS R/O       
 b  W95 FAT32      51 OnTrack DM6 Aux 9f  BSD/OS        e4  SpeedStor     
 c  W95 FAT32 (LBA) 52 CP/M          a0  IBM Thinkpad hi eb BeOS fs       
 e  W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5  FreeBSD       ee  GPT          
 f  W95 Ext'd (LBA) 54 OnTrackDM6     a6  OpenBSD        ef EFI (FAT-12/16/
10  OPUS          55  EZ-Drive      a7  NeXTSTEP       f0 Linux/PA-RISC b
11  Hidden FAT12   56  Golden Bow     a8 Darwin UFS     f1  SpeedStor     
12  Compaq diagnost 5c Priam Edisk    a9  NetBSD         f4 SpeedStor     
14  Hidden FAT16 <3 61 SpeedStor      ab  Darwin boot    f2  DOSsecondary  
16  Hidden FAT16   63  GNU HURD or Sys af HFS / HFS+     fb  VMware VMFS   
17  Hidden HPFS/NTF 64 Novell Netware  b7 BSDI fs        fc  VMwareVMKCORE 
18  AST SmartSleep  65 Novell Netware  b8 BSDI swap      fd  Linux raid auto
1b  Hidden W95 FAT3 70 DiskSecure Mult bb  Boot Wizardhid fe  LANstep       
1c  Hidden W95 FAT3 75 PC/IX          be Solaris boot   ff  BBT          
1e  Hidden W95 FAT1 80  OldMinix     

Command (m for help): 
Command (m for help): 
Command (m for help): 
Command (m for help): t
No partition is defined yet!

Command (m for help): n
Command action
   e  extended
   p  primary partition (1-4)
p
Partition number (1-4, default 1): 
Using default value 1
First sector (2048-8005631, default2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-8005631, default8005631): 
Using default value 8005631

Command (m for help): a
Partition number (1-4): 1

Command (m for help): c
DOS Compatibility flag is set (DEPRECATED!)

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

Calling ioctl() to re-read partition table.
Syncing disks.
linux-mrph:/ # 
linux-mrph:/ # 
linux-mrph:/ # mkfs.vfat -n 'boot' /dev/sd
sda   sda1  sda4 sda5  sda6 sda7  sdb  sdb1  
linux-mrph:/ # mkfs.vfat -n 'boot' /dev/sd
sda   sda1  sda4 sda5  sda6 sda7  sdb  sdb1  
linux-mrph:/ # mkfs.vfat -n 'boot' /dev/sdb
mkfs.vfat 3.0.10 (12 Sep 2010)
mkfs.vfat: Device partition expected, not making filesystem onentire device '/dev/sdb' (use -I to override)
linux-mrph:/ # mkfs.vfat -n 'boot' /dev/sdb1
mkfs.vfat 3.0.10 (12 Sep 2010)
linux-mrph:/ # fdisk /dev/sdb1

Command (m for help): p

Disk /dev/sdb1: 4097 MB, 4097835008 bytes
127 heads, 62 sectors/track, 1016 cylinders, total 8003584sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

     DeviceBoot      Start       End     Blocks   Id System

Command (m for help): n
Command action
   e  extended
   p  primary partition (1-4)
p
Partition number (1-4, default 1): 1
First sector (2048-8003583, default2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-8003583, default8003583): 
Using default value 8003583

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

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22:Invalid argument.
The kernel still uses the old table. The new table will beused at
the next reboot or after you run partprobe(8) orkpartx(8)
Syncing disks.
linux-mrph:/ # 
linux-mrph:/ # 
linux-mrph:/ # mkfs.vfat -n boot /dev/sdb1
mkfs.vfat 3.0.10 (12 Sep 2010)
linux-mrph:/ # umount /mnt
umount: /mnt: not mounted
linux-mrph:/ # umount /media/BOOT/