linux 下格式化U盘,制作U盘启动盘

系统属性:

1
2
huwei@huwei:~$  uname  -a
Linux huwei 3.16.0-44-generic  #59~14.04.1-Ubuntu SMP Tue Jul 7 15:07:27 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

查看硬盘信息,记得备份好U盘里面的资料,不然会抓狂的!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
huwei@huwei:~$  sudo  fdisk  -l
 
Disk  /dev/sda : 500.1 GB, 500107862016 bytes
255 heads, 63 sectors /track , 60801 cylinders, total 976773168 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: 0x0000848f
 
    Device Boot      Start         End      Blocks   Id  System
/dev/sda1    *        2048   961648639   480823296   83  Linux
/dev/sda2        961650686   976771071     7560193    5  Extended
/dev/sda5        961650688   976771071     7560192   82  Linux swap / Solaris
 
WARNING: GPT (GUID Partition Table) detected on  '/dev/sdb' ! The util  fdisk  doesn't support GPT. Use GNU Parted.
 
 
Disk  /dev/sdb : 7747 MB, 7747397632 bytes
255 heads, 63 sectors /track , 941 cylinders, total 15131636 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
/dev/sdb1                1    15131635     7565817+  ee  GPT


卸载U盘:

1
huwei@huwei:~$  umount  /dev/sdb2

格式化U盘

1
2
3
huwei@huwei:~$  sudo  mkfs.vfat  /dev/sdb
mkfs.fat 3.0.26 (2014-03-07)
mkfs.vfat: Device partition expected, not making filesystem on entire device  '/dev/sdb'  (use -I to override)

提示错误,使用 -I命令

1
2
huwei@huwei:~$  sudo  mkfs.vfat -I  /dev/sdb
mkfs.fat 3.0.26 (2014-03-07)

查看硬盘信息:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
huwei@huwei:~$  sudo  fdisk  -l
 
Disk  /dev/sda : 500.1 GB, 500107862016 bytes
255 heads, 63 sectors /track , 60801 cylinders, total 976773168 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: 0x0000848f
 
    Device Boot      Start         End      Blocks   Id  System
/dev/sda1    *        2048   961648639   480823296   83  Linux
/dev/sda2        961650686   976771071     7560193    5  Extended
/dev/sda5        961650688   976771071     7560192   82  Linux swap / Solaris
 
WARNING: GPT (GUID Partition Table) detected on  '/dev/sdb' ! The util  fdisk  doesn't support GPT. Use GNU Parted.
 
 
Disk  /dev/sdb : 7747 MB, 7747397632 bytes
239 heads, 62 sectors /track , 1021 cylinders, total 15131636 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

格式化成功,准备灌入ubuntu系统

1
2
3
4
5
6
7
8
huwei@huwei: /huwei/back/iso $ ll -a
total 8477836
drwxr-xr-x 2 huwei huwei       4096  6月 29 18:03 ./
drwxr-xr-x 7 huwei huwei       4096  7月  2 11:50 ../
-rw-rw-r-- 1 huwei huwei 4353378304  6月 15 11:09 CentOS-6.4-x86_64-bin-DVD1.iso
-rw-rw-r-- 1 huwei huwei 2653276160  6月 12 15:13 cn_windows_7_ultimate_with_sp1_x86_dvd_u_677486.iso
-rwxr-xr-x 1 huwei huwei 1044381696  6月  9 13:49 ubuntu-14.04.2-desktop-amd64.iso*
-rw-r--r-- 1 huwei huwei  630237184  6月 29 17:53 zh-hans_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-74070.iso

使用dd命令

1
huwei@huwei: /huwei/back/iso sudo  dd  if =ubuntu-14.04.2-desktop-amd64.iso of= /dev/sdb

等待.....等待....

1
2
3
4
huwei@huwei: /huwei/back/iso sudo  dd  if =ubuntu-14.04.2-desktop-amd64.iso of= /dev/sdb
2039808+0 records  in
2039808+0 records out
1044381696 bytes (1.0 GB) copied, 703.111 s, 1.5 MB /s

结束,成功!



本文转自 yawei555 51CTO博客,原文链接:http://blog.51cto.com/huwei555/1678117,如需转载请自行联系原作者

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值