zzz同学修复U盘的记录

root's password:
linux-mrph:~ # dd if=/dev/zero of=/dev/sdb bs=1024 count=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 on entire 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 identifier 0xaef21059.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

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

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without 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, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-16383, default 16383): 
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 on entire 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][-b backup-boot-sector]
       [-m boot-msg-file][-n volume-name][-i volume-id]
       [-s sectors-per-cluster][-S logical-sector-size][-f number-of-FATs]
       [-h hidden-sectors][-F fat-size][-r root-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=1024 count=1024*10
dd: invalid number `1024*10'
linux-mrph:~ # dd if=/dev/zero of=/dev/sdb bs=1024 count=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=1024 count=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 identifier 0x18fe40aa.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected 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, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-204799, default 204799): 
Using default value 204799

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without 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 204800 sectors
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, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-204799, default 204799): 
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] [-f fragment-size]
[-i bytes-per-inode] [-I inode-size] [-J journal-options]
[-G meta group size] [-N number-of-inodes]
[-m reserved-blocks-percentage] [-o creator-os]
[-g blocks-per-group] [-L volume-label] [-M last-mounted-directory]
[-O feature[,...]] [-r fs-revision] [-E extended-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 8005632 sectors
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, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-8005631, default 8005631): 
Using default value 8005631

Command (m for help): p

Disk /dev/sdb: 4098 MB, 4098883584 bytes
2 heads, 63 sectors/track, 63536 cylinders, total 8005632 sectors
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 8005632 sectors
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, default 8005631): 
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   0  33   16   1  33   48       2048    8003584 83
 2 00   0   0    0   0   0    0          0          0 00
 3 00   0   0    0   0   0    0          0          0 00
 4 00   0   0    0   0   0    0          0          0 00

Expert command (m for help): m
Command action
   b   move beginning of data in a partition
   c   change number of cylinders
   d   print the raw data in the partition table
   e   list extended partitions
   f   fix partition 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   quit without 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, default 63536): 
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 8005632 sectors
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 8005632 sectors
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=40480 bs=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 identifier 0x17cd5cb2.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

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

Command (m for help): p

Disk /dev/sdb: 4098 MB, 4098883584 bytes
127 heads, 62 sectors/track, 1016 cylinders, total 8005632 sectors
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, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-8005631, default 8005631): 
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   move beginning of data in a partition
   c   change number of cylinders
   d   print the raw data in the partition table
   e   list extended partitions
   f   fix partition 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   quit without 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          0          0 00
 2 00   0   0    0   0   0    0          0          0 00
 3 00   0   0    0   0   0    0          0          0 00
 4 00   0   0    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, default 1016): 
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   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without 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 identifier 0x6e71279b.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected 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  Linux extended  c7  Syrinx         
 5  Extended        41  PPC PReP Boot   86  NTFS volume set da  Non-FS data    
 6  FAT16           42  SFS             87  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS/exFAT 4d  QNX4.x          88  Linux plaintext de  Dell Utility   
 8  AIX             4e  QNX4.x 2nd part 8e  Linux LVM       df  BootIt         
 9  AIX bootable    4f  QNX4.x 3rd 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  DOS secondary  
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  VMware VMKCORE 
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fe  LANstep        
1c  Hidden W95 FAT3 75  PC/IX           be  Solaris boot    ff  BBT            
1e  Hidden W95 FAT1 80  Old Minix      

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

     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-8003583, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-8003583, default 8003583): 
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 be used at
the next reboot or after you run partprobe(8) or kpartx(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/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值