Chinaunix首页 | 论坛 | 博客
  • 博客访问: 597430
  • 博文数量: 239
  • 博客积分: 7941
  • 博客等级: 准将
  • 技术积分: 2467
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-10 12:14
个人简介

及时当勉励

文章分类

全部博文(239)

文章存档

2013年(29)

2011年(22)

2010年(188)

分类:

2010-03-09 23:44:05

   为了安装两个系统在一个U盘上面我想把U盘分区,这样就可以用两个系统了,可惜的是分区是分了,不过没有做成两个系统,倒是一个也进不去了,Bios不认识U盘了。只是从硬盘启动了。
    不过呢也学会了分区,刚才试了,在Windows下面只能看到第一个分区。
    费话不说,先把U盘查看一下。
hua@hua-desktop:~$ sudo fdisk -l /dev/sdb   #查看U盘信息
[sudo] password for hua:

Disk /dev/sdb: 254 MB, 254279680 bytes
8 heads, 61 sectors/track, 1017 cylinders
Units = cylinders of 488 * 512 = 249856 bytes
Sector size (logical / optimal IO): 512 bytes / 512 bytes
Disk identifier: 0x00015b81

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1             201         700      122000   83  Linux
/dev/sdb2   *         701        1017       77348   83  Linux
/dev/sdb3               1         200       48769+  83  Linux

Partition table entries are not in disk order
hua@hua-desktop:~$
  如果已经挂载了,要先 卸载  我的当然都没有挂载了。  卸载:sodu umount /mnt/  (不用说了吧。)
    分区:hua@hua-desktop:~$ sudo fdisk /dev/sdb

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel                #
编辑BSD的磁盘卷标
   c   toggle the dos compatibility flag         #切换DOS兼容标志
   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         #创建一个新的空DOS分区表
   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): d                    #把我原有的三个分区删除了。
Partition number (1-4): 1                     #第一分区。

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

Command (m for help): d
Selected partition 3

Command (m for help): 3                      #上一条语句已经把第三个已经删除过了,这一条就多余了。呵呵。
3: unknown command
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: 254 MB, 254279680 bytes
8 heads, 61 sectors/track, 1017 cylinders
Units = cylinders of 488 * 512 = 249856 bytes
Sector size (logical / optimal IO): 512 bytes / 512 bytes
Disk identifier: 0x00015b81

   Device Boot      Start         End      Blocks   Id  System                      #没有任何东西了。

Command (m for help): n                                                                          #添加分区
Command action
   e   extended                             #应该是扩展分区
   p   primary partition (1-4)                        #主分区(只有从1-4)里面选。
p                                          #选主分区
Partition number (1-4): 1                           #我选的是1,就是/dev/sdb1,如果是2就相当于/dev/sdb2。。。
First cylinder (1-1017, default 1):                                                                               #回车,默认是1,也可以其它的,反正总共大小是1-1017
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1017, default 1017):   #如果要多个分区,这里一定不要默认是1017,不然就只有一个分区了。
Using default value 1017

Command (m for help): p                    #查看一下。

Disk /dev/sdb: 254 MB, 254279680 bytes
8 heads, 61 sectors/track, 1017 cylinders
Units = cylinders of 488 * 512 = 249856 bytes
Sector size (logical / optimal IO): 512 bytes / 512 bytes
Disk identifier: 0x00015b81

   Device Boot      Start         End      Blocks   Id  System                     #多了一个分区了
/dev/sdb1               1        1017      248117+  83  Linux

Command (m for help): w                                                                #写入,不然刚才的操作都白费了。

最后是格式化:
sudo mkfs.ext3 /dev/sdb1                         #格成ext3的,要多一个文件吧。
sudo mkfs.vfat -F 32 -n disk /dev/sdb1        #通用的格式
其实不用格式化也可以挂载。挂载后再格式化也可以。

   

阅读(1466) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~