以前分区都是在WIN下做的,因为是图形界面,所以很容易就做到了。linux下呢,现在就尝试来做一做。
先查找了fdisk命令怎么使用。下面是这次做的步骤:
通过fdisk -l查看到活动硬盘是sda,于是
$ fdisk /dev/sda
The number of cylinders for this disk is set to 12161.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
选择n建立分区
Command (m for help): n
Command action
e extended
p primary partition (1-4)
将活动硬盘分为两个分区,所以分两次选择了p,建立基本分区。再键入p显示:
Command (m for help): p
Disk /dev/sda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 4864 39070048+ b linux
/dev/sda2 4865 12161 58613152+ b linux
再键入t对分区类型进行改变。
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)
w保存退出。
上面做得都很顺利,退到shell下可以使用fdisk -l看到:
chen@chen-laptop:~$ fdisk -l
Disk /dev/sda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 4864 39070048+ b W95 FAT32
/dev/sda2 4865 12161 58613152+ b W95 FAT32
但是...还没完。分完区以后还要做格式化,差点忘了,和WIN一样嘛^_^
$ sudo mkfs.vfat /dev/sda1
$ sudo mkfs.ext2 /dev/sda2
将活动硬盘重新接到计算机上,ubuntu自动挂载上了两个分区。
先查找了fdisk命令怎么使用。下面是这次做的步骤:
通过fdisk -l查看到活动硬盘是sda,于是
$ fdisk /dev/sda
The number of cylinders for this disk is set to 12161.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
选择n建立分区
Command (m for help): n
Command action
e extended
p primary partition (1-4)
将活动硬盘分为两个分区,所以分两次选择了p,建立基本分区。再键入p显示:
Command (m for help): p
Disk /dev/sda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 4864 39070048+ b linux
/dev/sda2 4865 12161 58613152+ b linux
再键入t对分区类型进行改变。
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)
w保存退出。
上面做得都很顺利,退到shell下可以使用fdisk -l看到:
chen@chen-laptop:~$ fdisk -l
Disk /dev/sda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 4864 39070048+ b W95 FAT32
/dev/sda2 4865 12161 58613152+ b W95 FAT32
但是...还没完。分完区以后还要做格式化,差点忘了,和WIN一样嘛^_^
$ sudo mkfs.vfat /dev/sda1
$ sudo mkfs.ext2 /dev/sda2
将活动硬盘重新接到计算机上,ubuntu自动挂载上了两个分区。