diff --git a/published/20190410 Managing Partitions with sgdisk.md b/published/20190410 Managing Partitions with sgdisk.md new file mode 100644 index 0000000000..bb8187a940 --- /dev/null +++ b/published/20190410 Managing Partitions with sgdisk.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10771-1.html) +[#]: subject: (Managing Partitions with sgdisk) +[#]: via: (https://fedoramagazine.org/managing-partitions-with-sgdisk/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +使用 sgdisk 管理分区 +====== + +![][1] + +[Roderick W. Smith][2] 的 `sgdisk` 命令可在命令行中管理硬盘的分区。下面将介绍使用它所需的基础知识。 + +使用 sgdisk 的大多数基本功能只需要了解以下六个参数: + +1、`-p` *打印* 分区表: + +``` +# sgdisk -p /dev/sda +``` + +2、 `-d x` *删除* 分区 x: + +``` +# sgdisk -d 1 /dev/sda +``` + +3、 `-n x:y:z` 创建一个编号 x 的*新*分区,从 y 开始,从 z 结束: + +``` +# sgdisk -n 1:1MiB:2MiB /dev/sda +``` + +4、`-c x:y` *更改*分区 x 的名称为 y: + +``` +# sgdisk -c 1:grub /dev/sda +``` + +5、`-t x:y` 将分区 x 的*类型*更改为 y: + +``` +# sgdisk -t 1:ef02 /dev/sda +``` + +6、`–list-types` 列出分区类型代码: + +``` +# sgdisk --list-types +``` + +![The SGDisk Command][3] + +如你在上面的例子中所见,大多数命令都要求将要操作的硬盘的[设备文件名][4]指定为最后一个参数。 + +可以组合上面的参数,这样你可以一次定义所有分区: + +``` +# sgdisk -n 1:1MiB:2MiB -t 1:ef02 -c 1:grub /dev/sda +``` + +在值的前面加上 `+` 或 `–` 符号,可以为某些字段指定相对值。如果你使用相对值,`sgdisk` 会为你做数学运算。例如,上面的例子可以写成: + +``` +# sgdisk -n 1:1MiB:+1MiB -t 1:ef02 -c 1:grub /dev/sda +``` + +`0` 值对于以下几个字段有特殊意义: + +* 对于*分区号*字段,0 表示应使用下一个可用编号(编号从 1 开始)。 +* 对于*起始地址*字段,0 表示使用最大可用空闲块的头。硬盘开头的一些空间始终保留给分区表本身。 +* 对于*结束地址*字段,0 表示使用最大可用空闲块的末尾。 + +通过在适当的字段中使用 `0` 和相对值,你可以创建一系列分区,而无需预先计算任何绝对值。例如,如果在一块空白硬盘中,以下 `sgdisk` 命令序列将创建典型 Linux 安装所需的所有基本分区: + +``` +# sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub /dev/sda +# sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot /dev/sda +# sgdisk -n 0:0:+4GiB -t 0:8200 -c 0:swap /dev/sda +# sgdisk -n 0:0:0 -t 0:8300 -c 0:root /dev/sda +``` + +上面的例子展示了如何为基于 BIOS 的计算机分区硬盘。基于 UEFI 的计算机上不需要 [grub 分区][5]。由于 `sgdisk` 在上面的示例中为你计算了所有绝对值,因此你可以在基于 UEFI 的计算机上跳过第一个命令,并且可以无需修改即可运行其余命令。同样,你可以跳过创建交换分区,并且不需要修改其余命令。 + +还有使用一个命令删除硬盘上所有分区的快捷方式: + +``` +# sgdisk --zap-all /dev/sda +``` + +关于最新和详细信息,请查看手册页: + +``` +$ man sgdisk +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/managing-partitions-with-sgdisk/ + +作者:[Gregory Bartholomew][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/managing-partitions-816x345.png +[2]: https://www.rodsbooks.com/ +[3]: https://fedoramagazine.org/wp-content/uploads/2019/04/sgdisk.jpg +[4]: https://en.wikipedia.org/wiki/Device_file +[5]: https://en.wikipedia.org/wiki/BIOS_boot_partition diff --git a/translated/tech/20190410 Managing Partitions with sgdisk.md b/translated/tech/20190410 Managing Partitions with sgdisk.md deleted file mode 100644 index 19f2752245..0000000000 --- a/translated/tech/20190410 Managing Partitions with sgdisk.md +++ /dev/null @@ -1,94 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Managing Partitions with sgdisk) -[#]: via: (https://fedoramagazine.org/managing-partitions-with-sgdisk/) -[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) - -使用 sgdisk 管理分区 -====== - -![][1] - -[Roderick W. Smith][2] 的 _sgdisk_ 命令可在命令行中管理硬盘的分区。下面将介绍使用它所需的基础知识。 - -以下六个参数是你使用 sgdisk 大多数基本功能所需了解的: - - 1. **-p** -_打印_ 分区表: -### sgdisk -p /dev/sda - 2. **-d x** -_删除_分区 x: -### sgdisk -d 1 /dev/sda - 3. **-n x:y:z** -创建一个编号 x 的_新_分区,从 y 开始,从 z 结束: -### sgdisk -n 1:1MiB:2MiB /dev/sda - 4. **-c x:y** -_更改_分区 x 的名称为 y: -### sgdisk -c 1:grub /dev/sda - 5. **-t x:y** -将分区 x 的_类型_更改为 y: -### sgdisk -t 1:ef02 /dev/sda - 6. **–list-types** -列出分区类型代码: -### sgdisk --list-types - - - -![The SGDisk Command][3] - -如你在上面的例子中所见,大多数命令都要求将要操作的硬盘的[设备文件名][4]指定为最后一个参数。 - -可以组合上面的参数,这样你可以一次定义所有分区: - -### sgdisk -n 1:1MiB:2MiB -t 1:ef02 -c 1:grub /dev/sda - -在值的前面加上 **+** 或 **–** 符号,可以为某些字段指定相对值。如果你使用相对值,sgdisk 会为你做数学运算。例如,上面的例子可以写成: - -### sgdisk -n 1:1MiB:+1MiB -t 1:ef02 -c 1:grub /dev/sda - -**0** 值对于以下几个字段是特殊情况: - - * 对于_分区号_字段,0 表示应使用下一个可用编号(编号从 1 开始)。 -  * 对于_起始地址_字段,0 表示使用最大可用空闲块的头。硬盘开头的一些空间始终保留给分区表本身。 -  * 对于_结束地址_字段,0 表示使用最大可用空闲块的末尾。 - - - -通过在适当的字段中使用 **0** 和相对值,你可以创建一系列分区,而无需预先计算任何绝对值。例如,如果在一块空白硬盘中,以下 sgdisk 命令序列将创建典型 Linux 安装所需的所有基本分区: - -### sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub /dev/sda -### sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot /dev/sda -### sgdisk -n 0:0:+4GiB -t 0:8200 -c 0:swap /dev/sda -### sgdisk -n 0:0:0 -t 0:8300 -c 0:root /dev/sda - -上面的例子展示了如何为基于 BIOS 的计算机分区硬盘。基于 UEFI 的计算机上不需要 [grub分区][5]。由于 sgdisk 在上面的示例中为你计算了所有绝对值,因此你可以在基于 UEFI 的计算机上跳过第一个命令,并且可以无需修改即可运行其余命令。同样,你可以跳过创建交换分区,并且不需要修改其余命令。 - -还有使用一个命令删除硬盘上所有分区的快捷方式: - -### sgdisk --zap-all /dev/sda - -关于最新和详细信息,请查看手册页: - -$ man sgdisk - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/managing-partitions-with-sgdisk/ - -作者:[Gregory Bartholomew][a] -选题:[lujun9972][b] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/glb/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/managing-partitions-816x345.png -[2]: https://www.rodsbooks.com/ -[3]: https://fedoramagazine.org/wp-content/uploads/2019/04/sgdisk.jpg -[4]: https://en.wikipedia.org/wiki/Device_file -[5]: https://en.wikipedia.org/wiki/BIOS_boot_partition diff --git a/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md b/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md deleted file mode 100644 index 67bd84fc31..0000000000 --- a/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md +++ /dev/null @@ -1,68 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Linux Foundation Training Courses Sale & Discount Coupon) -[#]: via: (https://itsfoss.com/linux-foundation-discount-coupon/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Linux 基金会培训课程销售和折扣优惠券 -====== - -Linux 基金会是一家非盈利组织,它雇用 Linux 创建者 Linus Torvalds 并管理 Linux 内核的开发。Linux 基金会旨在促进业界接受 Linux 和开源,并且在这方面做得很好。 - -开源工作是有需求的,这点没人比官方 Linux 组织 Linux 基金会了解更多。这就是为什么 Linux 基金会提供了许多关于 Linux 相关技术的培训和认证课程。你可以浏览 [Linux 基金会培训页面中的所有课程][1]。 - -### Linux 基金会最新优惠:所有课程享受 40% 限时折扣 - -目前,Linux 基金会为系统管理员、devops 和云专业人士提供了一些优惠。 - -目前,Linux 基金会为所有学习课程和认证包提供 40% 的大幅折扣,包括不断增长的云和 devops 的课程目录,如 Kubernetes! - -只需在结账时使用优惠券代码 **APRIL40** 即可获得折扣。 - -[Linux Foundation 40% Off (Coupon Code APRIL40)][2] - -_请注意,此优惠有效期至 2019 年 4 月 22 日。_ - -### Linux 基金会长期优惠券 - -你可以在任何时间获得 Linux 基金会提供的任何培训或认证课程 16% 的折扣。你所要做的就是在结账页面使用优惠码 **FOSS16**。 - -请注意,它也许不可与上面的系统管理员优惠一起使用。 - -[Get 16% off on Linux Foundation Courses with FOSS16 Code][1] - -本文包含推广链接。请阅读我们的[推广政策][3]。 - -#### 你应该获得认证吗? - -![][4] - -这是我经常被问到的问题。Linux 认证值得吗?回答是肯定的。 - -根据 [2018 年的开源职位报告][5],超过 80% 的开源专业人士表示,认证有助于他们的职业生涯。通过认证,你可以向潜在雇主展示技术知识,因此认证可以使你在一般情况下更具就业能力。 - -几乎一半的招聘经理表示,聘用经过认证的开源专业人员是他们的首要任务。 - -来自知名机构(如Linux 基金会、Red Hat、LPIC等)的认证在你刚毕业或者想要在职业生涯中转换到新领域时特别有用。 - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/linux-foundation-discount-coupon/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://shareasale.com/u.cfm?d=507759&m=59485&u=747593&afftrack= -[2]: http://shrsl.com/1k5ug -[3]: https://itsfoss.com/affiliate-policy/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/07/linux-foundation-training-certification-discount.png?ssl=1 -[5]: https://www.linuxfoundation.org/publications/open-source-jobs-report-2018/