计算机‎ > ‎软件‎ > ‎Linux‎ > ‎

Yeeloong8089D安装Gentoo补完

发布者:guo rue,发布时间:2014年3月15日 04:55   [ 更新时间:2014年5月19日 10:02 ]
在『Yeeloong8089D安装Gentoo』
http://wiki.guoruei.org/computer/software/linux/yeeloong8089d-install-gentoo
这篇帖子中的 『4、fdisk分区方案』 中 也许您已经正常分区。但是,没有正确执行规划好的分区。让我们来回顾一下。

4、fdisk分区方案
/boot划分128或者134MB的ext2分区
/划分ext3或者ext4分区
swap分区
命令:
① fdisk /dev/sda
用fdisk软件对/dev/sda硬盘进行操作
② d【删除分区,这时候会让你选一个数字,你可以先输入 1 ,后面接着重复【d】【2】【d】【3】【d】【4】来删除整个硬盘的所有分区】
这里只能有4个分区,只需d1d2d3d4。原因是,一个硬盘主分区至少有1个,最多4个,扩展分区可以没有,最多1个。且主分区+扩展分区总共不能超过4个。逻辑分区可以有若干个。
③【n】【p】【1】【1或直接回车】【+128M】,分一个128M分区
这里n回车p回车之后,输入1表示从硬盘的第一个块起分区回车,再次输入10表示第一个分区在第十块结束。这里的块大小约在8.2MB,约等于8MB吧。
④【n】【p】【2】【18或直接回车】【+2G】,分一个2G分区
这里n回车p回车之后,输入11表示接着上一个分区继续分区硬盘。再次输入267表示第一个分区在第二六七块结束。理由是由于这里的块大小约在8.2MB,约等于8MB吧。所以2GB应该是2048/8=256,这个256+11等于267。
⑤【n】【p】【3】【回车】【回车】,余下的分区
这里回车,就会把现有硬盘剩余空间自动用完。
⑥【t】【2】【82】将第二个分区转换为swap分区
⑦【w】写入并关闭fdisk
⑧【mdev -s】刷新分区信息

如果你对硬盘进行其他空间调整,也许可以试试以下两个命令。

fdisk -l 能列出机器中所有磁盘的个数,也能列出所有磁盘分区情况;比如:
[root@localhost]# fdisk -l
Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot Start End Blocks Id System
/dev/hda1 * 1 765 6144831 7 HPFS/NTFS
/dev/hda2 766 2805 16386300 c W95 FAT32 (LBA)
/dev/hda3 2806 7751 39728745 5 Extended
/dev/hda5 2806 3825 8193118+ 83 Linux
/dev/hda6 3826 5100 10241406 83 Linux
/dev/hda7 5101 5198 787153+ 82 Linux swap / Solaris
/dev/hda8 5199 6657 11719386 83 Linux
/dev/hda9 6658 7751 8787523+ 83 Linux
Disk /dev/sda: 60.0 GB, 60011642880 bytes
64 heads, 32 sectors/track, 57231 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
   Device Boot Start End Blocks Id System
/dev/sda1 1 57231 58604528 83 Linux

/dev/had和/dev/sda有两块硬盘,我们也可以指定fdisk -l 来查看其中一个硬盘的分区情况;
[root@localhost]# fdisk -l /dev/sda
Disk /dev/sda: 60.0 GB, 60011642880 bytes
64 heads, 32 sectors/track, 57231 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
   Device Boot Start End Blocks Id System
/dev/sda1 1 57231 58604528 83 Linux