注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Install/MBR Partitioning/zh-cn

From Funtoo
< Install
Revision as of 18:47, March 12, 2021 by Mmwweettyy (talk | contribs) (Created page with "如果输出这样的结果也不必担心,因为命令还是成功了:")
Jump to navigation Jump to search
Other languages:
English • ‎español • ‎polski • ‎português do Brasil • ‎русский • ‎中文(中国大陆)‎ • ‎中文(台灣)‎

安装指南:MBR 分区

Install Guide, Chapter 3 < Prev Next >

传统(BIOS/MBR)方法

   Note

如果使用 BIOS 启动,并且 Funtoo LiveCD 初始启动菜单是浅蓝色的,就使用这个方法。如果要使用 UEFI/GPT 磁盘格式,那么请至下一节继续。

First, it's a good idea to make sure that you've found the correct hard disk to partition. Try this command and verify that /dev/sda is the disk that you want to partition:

root # fdisk -l /dev/sda

Disk /dev/sda: 640.1 GB, 640135028736 bytes, 1250263728 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 label type: gpt

#         Start          End    Size  Type            Name
 1         2048   1250263694  596.2G  Linux filesyste Linux filesystem

现在,建议擦除磁盘上任何现有的 MBR 或 GPT 分区表,否则可能会在启动时混淆系统的 BIOS。我们使用 sgdisk 来完成这项工作。

   Warning

This will make any existing partitions inaccessible! You are strongly cautioned and advised to backup any critical data before proceeding.

root # sgdisk --zap-all /dev/sda

Creating new GPT entries.
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.

如果输出这样的结果也不必担心,因为命令还是成功了:

***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. 
***************************************************************

Now we will use fdisk to create the MBR partition table and partitions:

root # fdisk /dev/sda

Within fdisk, follow these steps:

清空分区表:

Command (m for help): o ↵

创建分区 1(引导)

Command (m for help): n ↵
Partition type (default p): 
Partition number (1-4, default 1): 
First sector: 
Last sector: +128M ↵

创建分区 2(交换)

Command (m for help): n ↵
Partition type (default p): 
Partition number (2-4, default 2): 
First sector: 
Last sector: +2G ↵
Command (m for help): t ↵ 
Partition number (1,2, default 2): 
Hex code (type L to list all codes): 82 ↵

创建根目录分区:

Command (m for help): n ↵
Partition type (default p): 
Partition number (3,4, default 3): 
First sector: 
Last sector: 

验证分区表:

Command (m for help): p

Disk /dev/sda: 298.1 GiB, 320072933376 bytes, 625142448 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
Disklabel type: dos
Disk identifier: 0x82abc9a6

Device    Boot     Start       End    Blocks  Id System
/dev/sda1           2048    264191    131072  83 Linux
/dev/sda2         264192   4458495   2097152  82 Linux swap / Solaris
/dev/sda3        4458496 625142447 310341976  83 Linux

将分区表写入磁盘:

Command (m for help): w

新的 MBR 分区表现在将被写入系统磁盘。

   Note

You're done with partitioning! Now, jump over to Creating filesystems.

Install Guide, Chapter 3 < Prev Next >