mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-12 01:40:10 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
dc133314e0
@ -0,0 +1,181 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12750-1.html)
|
||||
[#]: subject: (How to Remove Physical Volume from a Volume Group in LVM)
|
||||
[#]: via: (https://www.2daygeek.com/linux-remove-delete-physical-volume-pv-from-volume-group-vg-in-lvm/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
如何从 LVM 的卷组中删除物理卷?
|
||||
======
|
||||
|
||||

|
||||
|
||||
如果你的 LVM 不再需要使用某个设备,你可以使用 `vgreduce` 命令从卷组中删除物理卷。
|
||||
|
||||
`vgreduce` 命令可以通过删除物理卷来缩小卷组的容量。但要确保该物理卷没有被任何逻辑卷使用,请使用 `pvdisplay` 命令查看。如果物理卷仍在使用,你必须使用 `pvmove` 命令将数据转移到另一个物理卷。
|
||||
|
||||
数据转移后,它就可以从卷组中删除。
|
||||
|
||||
最后使用 `pvremove` 命令删除空物理卷上的 LVM 标签和 LVM 元数据。
|
||||
|
||||
* **第一部分:[如何在 Linux 中创建/配置 LVM(逻辑卷管理)][1]**
|
||||
* **第二部分:[如何在 Linux 中扩展/增加 LVM 大小(逻辑卷调整)][2]**
|
||||
* **第三部分:[如何在 Linux 中减少/缩小 LVM 大小(逻辑卷调整)][3]**
|
||||
|
||||

|
||||
|
||||
### 将扩展块移动到现有物理卷上
|
||||
|
||||
使用 `pvs` 命令检查是否使用了所需的物理卷(我们计划删除 LVM 中的 `/dev/sdc` 磁盘)。
|
||||
|
||||
```
|
||||
# pvs -o+pv_used
|
||||
|
||||
PV VG Fmt Attr PSize PFree Used
|
||||
/dev/sda myvg lvm2 a- 75.00G 14.00G 61.00G
|
||||
/dev/sdb myvg lvm2 a- 50.00G 45.00G 5.00G
|
||||
/dev/sdc myvg lvm2 a- 17.15G 12.15G 5.00G
|
||||
```
|
||||
|
||||
如果使用了,请检查卷组中的其他物理卷是否有足够的空闲<ruby>扩展块<rt>extent</rt></ruby>。
|
||||
|
||||
如果有的话,你可以在需要删除的设备上运行 `pvmove` 命令。扩展块将被分配到其他设备上。
|
||||
|
||||
```
|
||||
# pvmove /dev/sdc
|
||||
|
||||
/dev/sdc: Moved: 2.0%
|
||||
…
|
||||
/dev/sdc: Moved: 79.2%
|
||||
…
|
||||
/dev/sdc: Moved: 100.0%
|
||||
```
|
||||
|
||||
当 `pvmove` 命令完成后。再次使用 `pvs` 命令检查物理卷是否有空闲。
|
||||
|
||||
```
|
||||
# pvs -o+pv_used
|
||||
|
||||
PV VG Fmt Attr PSize PFree Used
|
||||
/dev/sda myvg lvm2 a- 75.00G 1.85G 73.15G
|
||||
/dev/sdb myvg lvm2 a- 50.00G 45.00G 5.00G
|
||||
/dev/sdc myvg lvm2 a- 17.15G 17.15G 0
|
||||
```
|
||||
|
||||
如果它是空闲的,使用 `vgreduce` 命令从卷组中删除物理卷 `/dev/sdc`。
|
||||
|
||||
```
|
||||
# vgreduce myvg /dev/sdc
|
||||
Removed "/dev/sdc" from volume group "vg01"
|
||||
```
|
||||
|
||||
最后,运行 `pvremove` 命令从 LVM 配置中删除磁盘。现在,磁盘已经完全从 LVM 中移除,可以用于其他用途。
|
||||
|
||||
```
|
||||
# pvremove /dev/sdc
|
||||
Labels on physical volume "/dev/sdc" successfully wiped.
|
||||
```
|
||||
|
||||
### 移动扩展块到新磁盘
|
||||
|
||||
如果你在卷组中的其他物理卷上没有足够的可用扩展。使用以下步骤添加新的物理卷。
|
||||
|
||||
向存储组申请新的 LUN。分配完毕后,运行以下命令来[在 Linux 中发现新添加的 LUN 或磁盘][5]。
|
||||
|
||||
```
|
||||
# ls /sys/class/scsi_host
|
||||
host0
|
||||
```
|
||||
|
||||
```
|
||||
# echo "- - -" > /sys/class/scsi_host/host0/scan
|
||||
```
|
||||
|
||||
```
|
||||
# fdisk -l
|
||||
```
|
||||
|
||||
操作系统中检测到磁盘后,使用 `pvcreate` 命令创建物理卷。
|
||||
|
||||
```
|
||||
# pvcreate /dev/sdd
|
||||
Physical volume "/dev/sdd" successfully created
|
||||
```
|
||||
|
||||
使用以下命令将新的物理卷 `/dev/sdd` 添加到现有卷组 `vg01` 中。
|
||||
|
||||
```
|
||||
# vgextend vg01 /dev/sdd
|
||||
Volume group "vg01" successfully extended
|
||||
```
|
||||
|
||||
现在,使用 `pvs` 命令查看你添加的新磁盘 `/dev/sdd`。
|
||||
|
||||
```
|
||||
# pvs -o+pv_used
|
||||
|
||||
PV VG Fmt Attr PSize PFree Used
|
||||
/dev/sda myvg lvm2 a- 75.00G 14.00G 61.00G
|
||||
/dev/sdb myvg lvm2 a- 50.00G 45.00G 5.00G
|
||||
/dev/sdc myvg lvm2 a- 17.15G 12.15G 5.00G
|
||||
/dev/sdd myvg lvm2 a- 60.00G 60.00G 0
|
||||
```
|
||||
|
||||
使用 `pvmove` 命令将数据从 `/dev/sdc` 移动到 `/dev/sdd`。
|
||||
|
||||
```
|
||||
# pvmove /dev/sdc /dev/sdd
|
||||
|
||||
/dev/sdc: Moved: 10.0%
|
||||
…
|
||||
/dev/sdc: Moved: 79.7%
|
||||
…
|
||||
/dev/sdc: Moved: 100.0%
|
||||
```
|
||||
|
||||
数据移动到新磁盘后。再次使用 `pvs` 命令检查物理卷是否空闲。
|
||||
|
||||
```
|
||||
# pvs -o+pv_used
|
||||
|
||||
PV VG Fmt Attr PSize PFree Used
|
||||
/dev/sda myvg lvm2 a- 75.00G 14.00G 61.00G
|
||||
/dev/sdb myvg lvm2 a- 50.00G 45.00G 5.00G
|
||||
/dev/sdc myvg lvm2 a- 17.15G 17.15G 0
|
||||
/dev/sdd myvg lvm2 a- 60.00G 47.85G 12.15G
|
||||
```
|
||||
|
||||
如果空闲,使用 `vgreduce` 命令从卷组中删除物理卷 `/dev/sdc`。
|
||||
|
||||
```
|
||||
# vgreduce myvg /dev/sdc
|
||||
Removed "/dev/sdc" from volume group "vg01"
|
||||
```
|
||||
|
||||
最后,运行 `pvremove` 命令从 LVM 配置中删除磁盘。现在,磁盘已经完全从 LVM 中移除,可以用于其他用途。
|
||||
|
||||
```
|
||||
# pvremove /dev/sdc
|
||||
Labels on physical volume "/dev/sdc" successfully wiped.
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/linux-remove-delete-physical-volume-pv-from-volume-group-vg-in-lvm/
|
||||
|
||||
作者:[Magesh Maruthamuthu][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://www.2daygeek.com/author/magesh/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://linux.cn/article-12670-1.html
|
||||
[2]: https://linux.cn/article-12673-1.html
|
||||
[3]: https://linux.cn/article-12740-1.html
|
||||
[4]: https://www.2daygeek.com/wp-content/uploads/2020/10/remove-delete-physical-volume-pv-from-volume-group-vg-lvm-linux-2.png
|
||||
[5]: https://www.2daygeek.com/scan-detect-luns-scsi-disks-on-redhat-centos-oracle-linux/
|
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12752-1.html)
|
||||
[#]: subject: (2 Ways to Download Files From Linux Terminal)
|
||||
[#]: via: (https://itsfoss.com/download-files-from-linux-terminal/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
如果你被困在 Linux 终端,比如说在服务器上,如何从终端下载文件?
|
||||
|
||||
在 Linux 中是没有下载命令的,但是有几个 Linux 命令可用于下载文件。
|
||||
在 Linux 中是没有 `download` 命令的,但是有几个 Linux 命令可用于下载文件。
|
||||
|
||||
在这篇终端技巧中,你将学习两种在 Linux 中使用命令行下载文件的方法。
|
||||
|
||||
@ -22,15 +22,15 @@
|
||||
|
||||
![][1]
|
||||
|
||||
[wget][2] 也许是 Linux 和类 UNIX 系统中使用最多的命令行下载管理器。你可以使用 wget 下载一个文件、多个文件、整个目录甚至整个网站。
|
||||
[wget][2] 也许是 Linux 和类 UNIX 系统中使用最多的命令行下载管理器。你可以使用 `wget` 下载一个文件、多个文件、整个目录甚至整个网站。
|
||||
|
||||
wget 是非交互式的,可以轻松地在后台工作。这意味着你可以很容易地在脚本中使用它,甚至构建像 [uGet 下载管理器][3]这样的工具。
|
||||
`wget` 是非交互式的,可以轻松地在后台工作。这意味着你可以很容易地在脚本中使用它,甚至构建像 [uGet 下载管理器][3]这样的工具。
|
||||
|
||||
让我们看看如何使用 wget 从终端下载文件。
|
||||
让我们看看如何使用 `wget` 从终端下载文件。
|
||||
|
||||
#### 安装 wget
|
||||
|
||||
大多数 Linux 发行版都预装了 wget。它也可以在大多数发行版的仓库中找到,你可以使用发行版的包管理器轻松安装它。
|
||||
大多数 Linux 发行版都预装了 `wget`。它也可以在大多数发行版的仓库中找到,你可以使用发行版的包管理器轻松安装它。
|
||||
|
||||
在基于 Ubuntu 和 Debian 的发行版上,你可以使用 [apt 包管理器][4]命令:
|
||||
|
||||
@ -48,7 +48,7 @@ wget URL
|
||||
|
||||
![][5]
|
||||
|
||||
要下载多个文件,你必须将它们的 URL 保存在一个文本文件中,并将该文件作为输入提供给 wget,就像这样:
|
||||
要下载多个文件,你必须将它们的 URL 保存在一个文本文件中,并将该文件作为输入提供给 `wget`,就像这样:
|
||||
|
||||
```
|
||||
wget -i download_files.txt
|
||||
@ -56,9 +56,9 @@ wget -i download_files.txt
|
||||
|
||||
#### 用 wget 下载不同名字的文件
|
||||
|
||||
你会注意到,一个网页在 wget 中几乎总是以 index.html 的形式保存。为下载的文件提供自定义名称是个好主意。
|
||||
你会注意到,网页在 `wget` 中几乎总是以 `index.html` 的形式保存。为下载的文件提供自定义名称是个好主意。
|
||||
|
||||
你可以在下载时使用 -O (大写字母 O) 选项来提供输出文件名。
|
||||
你可以在下载时使用 `-O` (大写字母 `O`) 选项来提供输出文件名:
|
||||
|
||||
```
|
||||
wget -O filename URL
|
||||
@ -68,7 +68,7 @@ wget -O filename URL
|
||||
|
||||
#### 用 wget 下载一个文件夹
|
||||
|
||||
假设你正在浏览一个 FTP 服务器,你需要下载整个目录,你可以使用递归选项:
|
||||
假设你正在浏览一个 FTP 服务器,你需要下载整个目录,你可以使用递归选项 `-r`:
|
||||
|
||||
```
|
||||
wget -r ftp://server-address.com/directory
|
||||
@ -76,14 +76,12 @@ wget -r ftp://server-address.com/directory
|
||||
|
||||
#### 使用 wget 下载整个网站
|
||||
|
||||
是的,你完全可以做到这一点。你可以用 wget 镜像整个网站。我说的下载整个网站是指整个面向公众的网站结构。
|
||||
|
||||
虽然你可以直接使用镜像选项 -m,但最好加上:
|
||||
|
||||
* –convert-links :链接将被转换,使内部链接指向下载的资源,而不是网站。
|
||||
* –page-requisites:下载额外的东西,如样式表,使页面在离线状态下看起来更好。
|
||||
是的,你完全可以做到这一点。你可以用 `wget` 镜像整个网站。我说的下载整个网站是指整个面向公众的网站结构。
|
||||
|
||||
虽然你可以直接使用镜像选项 `-m`,但最好加上:
|
||||
|
||||
* `–convert-links`:链接将被转换,使内部链接指向下载的资源,而不是网站。
|
||||
* `–page-requisites`:下载额外的东西,如样式表,使页面在离线状态下看起来更好。
|
||||
|
||||
```
|
||||
wget -m --convert-links --page-requisites website_address
|
||||
@ -93,7 +91,7 @@ wget -m --convert-links --page-requisites website_address
|
||||
|
||||
#### 额外提示:恢复未完成的下载
|
||||
|
||||
如果你因为某些原因按 C 键中止了下载,你可以用选项 -c 恢复之前的下载:
|
||||
如果你因为某些原因按 `CTRL-C` 键中止了下载,你可以用选项 `-c` 恢复之前的下载:
|
||||
|
||||
```
|
||||
wget -c
|
||||
@ -101,13 +99,13 @@ wget -c
|
||||
|
||||
### 使用 curl 在 Linux 命令行中下载文件
|
||||
|
||||
和 wget 一样,[curl][8] 也是 Linux 终端中最常用的下载文件的命令之一。[使用 curl][9] 的方法有很多,但我在这里只关注简单的下载。
|
||||
和 `wget` 一样,[curl][8] 也是 Linux 终端中最常用的下载文件的命令之一。[使用 curl][9] 的方法有很多,但我在这里只关注简单的下载。
|
||||
|
||||
#### 安装 curl
|
||||
|
||||
虽然 curl 并不是预装的,但在大多数发行版的官方仓库中都有。你可以使用你的发行版的包管理器来安装它。
|
||||
虽然 `curl` 并不是预装的,但在大多数发行版的官方仓库中都有。你可以使用你的发行版的包管理器来安装它。
|
||||
|
||||
要[在 Ubuntu][10] 和其他基于 Debian 的发行版上安装 curl,请使用以下命令:
|
||||
要[在 Ubuntu][10] 和其他基于 Debian 的发行版上安装 `curl`,请使用以下命令:
|
||||
|
||||
```
|
||||
sudo apt install curl
|
||||
@ -115,9 +113,9 @@ sudo apt install curl
|
||||
|
||||
#### 使用 curl 下载文件或网页
|
||||
|
||||
如果你在使用 curl 命令时没有在 URL 中带任何选项,它就会读取文件并打印在终端上。
|
||||
如果你在使用 `curl` 命令时没有在 URL 中带任何选项,它就会读取文件并打印在终端上。
|
||||
|
||||
要在 Linux 终端中使用 curl 命令下载文件,你必须使用 -O(大写字母 O)选项:
|
||||
要在 Linux 终端中使用 `curl` 命令下载文件,你必须使用 `-O`(大写字母 `O`)选项:
|
||||
|
||||
```
|
||||
curl -O URL
|
||||
@ -125,17 +123,17 @@ curl -O URL
|
||||
|
||||
![][11]
|
||||
|
||||
在 Linux 中,用 curl 下载多个文件是比较简单的。你只需要指定多个 URL 即可:
|
||||
在 Linux 中,用 `curl` 下载多个文件是比较简单的。你只需要指定多个 URL 即可:
|
||||
|
||||
```
|
||||
curl -O URL1 URL2 URL3
|
||||
```
|
||||
|
||||
请记住,curl 不像 wget 那么简单。当 wget 将网页保存为 index.html 时,curl 会抱怨远程文件没有网页的名字。你必须按照下一节的描述用一个自定义的名字来保存它。
|
||||
请记住,`curl` 不像 `wget` 那么简单。`wget` 可以将网页保存为 `index.html`,`curl` 却会抱怨远程文件没有网页的名字。你必须按照下一节的描述用一个自定义的名字来保存它。
|
||||
|
||||
#### 用不同的名字下载文件
|
||||
|
||||
这可能会让人感到困惑,但如果要为下载的文件提供一个自定义的名称(而不是原始名称),你必须使用 -o(小写 O)选项:
|
||||
这可能会让人感到困惑,但如果要为下载的文件提供一个自定义的名称(而不是原始名称),你必须使用 `-o`(小写 `O`)选项:
|
||||
|
||||
```
|
||||
curl -o filename URL
|
||||
@ -143,23 +141,23 @@ curl -o filename URL
|
||||
|
||||
![][12]
|
||||
|
||||
有些时候,curl 并不能像你期望的那样下载文件,你必须使用选项 -L(代表位置)来正确下载。这是因为有些时候,链接会重定向到其他链接,而使用选项 -L,它就会跟随最终的链接。
|
||||
有些时候,`curl` 并不能像你期望的那样下载文件,你必须使用选项 `-L`(代表位置)来正确下载。这是因为有些时候,链接会重定向到其他链接,而使用选项 `-L`,它就会跟随最终的链接。
|
||||
|
||||
#### 用 curl 暂停和恢复下载
|
||||
|
||||
和 wget 一样,你也可以用 curl 的 -c 选项恢复暂停的下载:
|
||||
和 `wget` 一样,你也可以用 `curl` 的 `-c` 选项恢复暂停的下载:
|
||||
|
||||
```
|
||||
curl -c URL
|
||||
```
|
||||
|
||||
**总结**
|
||||
### 总结
|
||||
|
||||
和以往一样,在 Linux 中做同一件事有多种方法。从终端下载文件也不例外。
|
||||
|
||||
wget 和 curl 只是 Linux 中最流行的两个下载文件的命令。还有更多这样的命令行工具。基于终端的网络浏览器,如 [elinks][13]、[w3m][14] 等也可以用于在命令行下载文件。
|
||||
`wget` 和 `curl` 只是 Linux 中最流行的两个下载文件的命令。还有更多这样的命令行工具。基于终端的网络浏览器,如 [elinks][13]、[w3m][14] 等也可以用于在命令行下载文件。
|
||||
|
||||
就个人而言,对于一个简单的下载,我更喜欢使用 wget 而不是 curl。它更简单,也不会让你感到困惑,因为你可能很难理解为什么 curl 不能以预期的格式下载文件。
|
||||
就个人而言,对于一个简单的下载,我更喜欢使用 `wget` 而不是 `curl`。它更简单,也不会让你感到困惑,因为你可能很难理解为什么 `curl` 不能以预期的格式下载文件。
|
||||
|
||||
欢迎你的反馈和建议。
|
||||
|
||||
@ -170,7 +168,7 @@ via: https://itsfoss.com/download-files-from-linux-terminal/
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (MjSeven)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,99 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Try Linux on any computer with this bootable USB tool)
|
||||
[#]: via: (https://opensource.com/article/20/10/fedora-media-writer)
|
||||
[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro)
|
||||
|
||||
Try Linux on any computer with this bootable USB tool
|
||||
======
|
||||
Fedora Media Writer is a hassle-free way to create a live USB to give
|
||||
Linux a try.
|
||||
![Multiple USB plugs in different colors][1]
|
||||
|
||||
[Fedora Media Writer][2] is a small, lightweight, comprehensive tool that simplifies the Linux getting-started experience. It downloads and writes Fedora Workstation or Server onto a USB drive that can boot up on any system, making it accessible for you to try Fedora Linux without having to install it to your hard drive.
|
||||
|
||||
The Media Writer tool can be used to create a live, bootable USB. After installing the Fedora Media Writer application on your platform, you can download and flash the latest stable version of Fedora Workstation or Server, or you can choose any other image you've downloaded. And it isn't limited to Intel 64-bit devices. It's also available for ARM devices, [such as the Raspberry Pi][3], which are becoming more powerful and useful every day.
|
||||
|
||||
![Fedora Media Writer main screen][4]
|
||||
|
||||
(Sumantro Mukherjee, [CC BY-SA 4.0][5])
|
||||
|
||||
### Install Fedora Media Writer
|
||||
|
||||
You have several options for [installing Fedora Media Writer][6]. You can [build it from source][7] on GitHub, download it for macOS or Windows, use an RPM with **dnf** or **yum**, or get it as a Flatpak.
|
||||
|
||||
On Fedora:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install mediawriter`
|
||||
```
|
||||
|
||||
See the [Releases][8] section of the GitHub repo for the latest version.
|
||||
|
||||
### Prepare your media
|
||||
|
||||
The first thing you need is a USB drive for your Linux OS to be installed onto. This is what Fedora Media Writer will flash. This drive must be either blank or expendable because **all data on the USB drive will be erased.** If there's any data—even just one file—that you don't want to lose, then you must back it up before continuing!
|
||||
|
||||
Once you've got a USB drive that you've confirmed is expendable, plug it into your computer and launch Fedora Media Writer.
|
||||
|
||||
### Use Fedora Media Writer
|
||||
|
||||
When you launch Fedora Media Writer, you're presented with a screen that prompts you to acquire a bootable image from the Internet, or to load a custom image from your hard drive. The first selections are the latest releases of Fedora: Workstation for desktops and laptops, and Server for virtualization, rack servers, or anything you want to run as a server.
|
||||
|
||||
Should you select one of the Fedora images, Media Writer downloads a disc image (usually called an "iso", after its filename extension of **.iso**) and saves it to your `Downloads` folder so you can reuse it to flash another drive if you want.
|
||||
|
||||
![Select your image][9]
|
||||
|
||||
Also available are Fedora Spins, which are images from the Fedora community meant to satisfy niche interests. For instance, if you're a fan of the [MATE desktop][10], then you'll be pleased to find a MATE "spin" available from Media Writer. There are many to choose from, so scroll through to see them all. If you're new to Linux, don't be overwhelmed or confused: the extra options are intended for longtime users who have developed preferences aside from the defaults, so it's safe for you to just use the Workstation or Server option depending on whether you want to run Fedora as a desktop or as a server OS.
|
||||
|
||||
If you need an image for a different CPU than the one you're currently using, select the CPU architecture from the drop-down menu in the upper-right corner of the window.
|
||||
|
||||
If you have an image saved to your hard drive already, select the **Custom Image** option and select the **.iso** file of the distribution you want to flash to USB.
|
||||
|
||||
### Writing to a USB drive
|
||||
|
||||
Once you've downloaded or selected an image, you must confirm that you want to write the image to your drive.
|
||||
|
||||
The drive selection drop-down menu only shows external drives, so there's no chance of you accidentally overwriting your own hard drive. This is an important feature of Fedora Media Writer, and one that makes it much safer than many manual instructions you might see elsewhere online. However, if you have more than one external drive attached to your computer, you should remove them all except the one you want to overwrite, just for added safety.
|
||||
|
||||
Select the drive you want the image to be installed onto, and click the **Write to Disk** button.
|
||||
|
||||
![Media write][11]
|
||||
|
||||
|
||||
|
||||
Wait a while for the image to be written to your drive, and then check out Don Watkins' excellent overview of [how to boot to Linux from a USB drive][12] .
|
||||
|
||||
### Get started with Linux
|
||||
|
||||
Fedora Media Writer is a way to flash Fedora Workstation or Server, or any Linux distribution, to a USB drive so you can try it out before you install it on your device. Give it a try, and share your experience and questions in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/10/fedora-media-writer
|
||||
|
||||
作者:[Sumantro Mukherjee][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/sumantro
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/usb-hardware.png?itok=ROPtNZ5V (Multiple USB plugs in different colors)
|
||||
[2]: https://github.com/FedoraQt/MediaWriter
|
||||
[3]: https://fedoraproject.org/wiki/Architectures/ARM/Raspberry_Pi
|
||||
[4]: https://opensource.com/sites/default/files/uploads/fmw_mainscreen.png (Fedora Media Writer main screen)
|
||||
[5]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[6]: https://docs.fedoraproject.org/en-US/fedora/f32/install-guide/install/Preparing_for_Installation/#_fedora_media_writer
|
||||
[7]: https://github.com/FedoraQt/MediaWriter#building
|
||||
[8]: https://github.com/FedoraQt/MediaWriter/releases
|
||||
[9]: https://opensource.com/sites/default/files/mediawriter-image.png
|
||||
[10]: https://opensource.com/article/19/12/mate-linux-desktop
|
||||
[11]: https://opensource.com/sites/default/files/mediawriter-write.png (Media write)
|
||||
[12]: https://opensource.com/article/20/4/first-linux-computer
|
@ -1,185 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Remove Physical Volume from a Volume Group in LVM)
|
||||
[#]: via: (https://www.2daygeek.com/linux-remove-delete-physical-volume-pv-from-volume-group-vg-in-lvm/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
如何从 LVM 的卷组中删除物理卷?
|
||||
======
|
||||
|
||||
如果 LVM 不再需要使用某个设备,你可以使用 vgreduce 命令从卷组中删除物理卷。
|
||||
|
||||
vgreduce 命令通过删除物理卷来缩小卷组的容量。
|
||||
|
||||
但要确保物理卷没有被任何逻辑卷使用,请使用 pvdisplay 命令。
|
||||
|
||||
如果物理卷仍在使用,你必须使用 pvmove 命令将数据转移到另一个物理卷。
|
||||
|
||||
数据转移后,它就可以从卷组中删除。
|
||||
|
||||
最后使用 pvremove 命令删除空物理卷上的 LVM 标签和 LVM 元数据。
|
||||
|
||||
* **第一部分:[如何在 Linux 中创建/配置 LVM(逻辑卷管理)][1]**。
|
||||
* **第二部分:[如何在 Linux 中扩展/增加 LVM 大小(逻辑卷调整)][2]**。
|
||||
* **第三部分:[如何在 Linux 中减少/缩小 LVM 大小(逻辑卷调整)][3]**。
|
||||
|
||||
|
||||
|
||||
![][4]
|
||||
|
||||
### 1) 将扩展移动到现有物理卷上
|
||||
|
||||
使用 pvs 命令检查是否使用了所需的物理卷(我们计划删除 LVM 中的 **“/dev/sdb1”** 磁盘)。
|
||||
|
||||
```
|
||||
# pvs -o+pv_used
|
||||
|
||||
PV VG Fmt Attr PSize PFree Used
|
||||
/dev/sda1 myvg lvm2 a- 75.00G 14.00G 61.00G
|
||||
/dev/sdb1 myvg lvm2 a- 50.00G 45.00G 5.00G
|
||||
/dev/sdc1 myvg lvm2 a- 17.15G 12.15G 5.00G
|
||||
```
|
||||
|
||||
如果使用了,请检查卷组中的其他物理卷是否有足够的空闲空间。
|
||||
|
||||
如果有的话,你可以在需要删除的设备上运行 pvmove 命令。扩展将被分配到其他设备上。
|
||||
|
||||
```
|
||||
# pvmove /dev/sdb1
|
||||
|
||||
/dev/sdb1: Moved: 2.0%
|
||||
…
|
||||
/dev/sdb1: Moved: 79.2%
|
||||
…
|
||||
/dev/sdb1: Moved: 100.0%
|
||||
```
|
||||
|
||||
当 pvmove 命令完成后。再次使用 pvs 命令检查物理卷是否有空闲。
|
||||
|
||||
```
|
||||
# pvs -o+pv_used
|
||||
|
||||
PV VG Fmt Attr PSize PFree Used
|
||||
/dev/sda1 myvg lvm2 a- 75.00G 9.00G 66.00G
|
||||
/dev/sdb1 myvg lvm2 a- 50.00G 50.00G 0
|
||||
/dev/sdc1 myvg lvm2 a- 17.15G 12.15G 5.00G
|
||||
```
|
||||
|
||||
如果它是空闲的,使用 vgreduce 命令从卷组中删除物理卷 /dev/sdb1。
|
||||
|
||||
```
|
||||
# vgreduce myvg /dev/sdb1
|
||||
Removed "/dev/sdb1" from volume group "myvg"
|
||||
```
|
||||
|
||||
最后,运行 pvremove 命令从 LVM 配置中删除磁盘。现在,磁盘已经完全从 LVM 中移除,可以用于其他用途。
|
||||
|
||||
```
|
||||
# pvremove /dev/sdb1
|
||||
Labels on physical volume "/dev/sdb1" successfully wiped.
|
||||
```
|
||||
|
||||
### 2) 移动扩展到新磁盘
|
||||
|
||||
如果你在卷组中的其他物理卷上没有足够的可用扩展。使用以下步骤添加新的物理卷。
|
||||
|
||||
向存储组申请新的 LUN。分配完毕后,运行以下命令来**[在 Linux 中发现新添加的 LUN 或磁盘][5]**。
|
||||
|
||||
```
|
||||
# ls /sys/class/scsi_host
|
||||
host0
|
||||
```
|
||||
|
||||
```
|
||||
# echo "- - -" > /sys/class/scsi_host/host0/scan
|
||||
```
|
||||
|
||||
```
|
||||
# fdisk -l
|
||||
```
|
||||
|
||||
操作系统中检测到磁盘后,使用 pvcreate 命令创建物理卷。
|
||||
|
||||
```
|
||||
# pvcreate /dev/sdd1
|
||||
Physical volume "/dev/sdd1" successfully created
|
||||
```
|
||||
|
||||
使用以下命令将新的物理卷 /dev/sdd1 添加到现有卷组 vg01 中。
|
||||
|
||||
```
|
||||
# vgextend vg01 /dev/sdd1
|
||||
Volume group "vg01" successfully extended
|
||||
```
|
||||
|
||||
现在,使用 pvs 命令查看你添加的新磁盘 **“/dev/sdd1”**。
|
||||
|
||||
```
|
||||
# pvs -o+pv_used
|
||||
|
||||
PV VG Fmt Attr PSize PFree Used
|
||||
/dev/sda1 myvg lvm2 a- 75.00G 14.00G 61.00G
|
||||
/dev/sdb1 myvg lvm2 a- 50.00G 0 50.00G
|
||||
/dev/sdc1 myvg lvm2 a- 17.15G 12.15G 5.00G
|
||||
/dev/sdd1 myvg lvm2 a- 60.00G 60.00G 0
|
||||
```
|
||||
|
||||
使用 pvmove 命令将数据从 /dev/sdb1 移动到 /dev/sdd1。
|
||||
|
||||
```
|
||||
# pvmove /dev/sdb1 /dev/sdd1
|
||||
|
||||
/dev/sdb1: Moved: 10.0%
|
||||
…
|
||||
/dev/sdb1: Moved: 79.7%
|
||||
…
|
||||
/dev/sdb1: Moved: 100.0%
|
||||
```
|
||||
|
||||
数据移动到新磁盘后。再次使用 pvs 命令检查物理卷是否空闲。
|
||||
|
||||
```
|
||||
# pvs -o+pv_used
|
||||
|
||||
PV VG Fmt Attr PSize PFree Used
|
||||
/dev/sda1 myvg lvm2 a- 75.00G 14.00G 61.00G
|
||||
/dev/sdb1 myvg lvm2 a- 50.00G 50.00G 0
|
||||
/dev/sdc1 myvg lvm2 a- 17.15G 12.15G 5.00G
|
||||
/dev/sdd1 myvg lvm2 a- 60.00G 10.00G 50.00G
|
||||
```
|
||||
|
||||
如果空闲,使用 vgreduce 命令从卷组中删除物理卷 /dev/sdb1。
|
||||
|
||||
```
|
||||
# vgreduce myvg /dev/sdb1
|
||||
Removed "/dev/sdb1" from volume group "myvg"
|
||||
```
|
||||
|
||||
最后,运行 pvremove 命令从 LVM 配置中删除磁盘。现在,磁盘已经完全从 LVM 中移除,可以用于其他用途。
|
||||
|
||||
```
|
||||
# pvremove /dev/sdb1
|
||||
Labels on physical volume "/dev/sdb1" successfully wiped.
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/linux-remove-delete-physical-volume-pv-from-volume-group-vg-in-lvm/
|
||||
|
||||
作者:[Magesh Maruthamuthu][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://www.2daygeek.com/author/magesh/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.2daygeek.com/create-lvm-storage-logical-volume-manager-in-linux/
|
||||
[2]: https://www.2daygeek.com/extend-increase-resize-lvm-logical-volume-in-linux/
|
||||
[3]: https://www.2daygeek.com/reduce-shrink-decrease-resize-lvm-logical-volume-in-linux/
|
||||
[4]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||
[5]: https://www.2daygeek.com/scan-detect-luns-scsi-disks-on-redhat-centos-oracle-linux/
|
@ -0,0 +1,98 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Try Linux on any computer with this bootable USB tool)
|
||||
[#]: via: (https://opensource.com/article/20/10/fedora-media-writer)
|
||||
[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro)
|
||||
|
||||
用这个可引导的 USB 工具在任何电脑上尝试 Linux
|
||||
======
|
||||
Fedora Media Writer 是创建 Live USB 以尝试 Linux 的方便的方法。
|
||||
![Multiple USB plugs in different colors][1]
|
||||
|
||||
[Fedora Media Writer][2] 是一个小巧、轻量、全面的工具,它简化了 Linux 的入门体验。它将 Fedora Workstation 或 Server 下载并写入一个可以在任何系统上引导的 USB 驱动器,使你无需将其安装到硬盘上就可以试用 Fedora Linux。
|
||||
|
||||
Media Writer 工具可以用来创建一个实时的、可引导的 USB。在你的平台上安装 Fedora Media Writer 应用后,你可以下载并烧录最新的 Fedora Workstation 或 Server 稳定版,也可以选择你下载的任何其他镜像。而且它并不局限于英特尔 64 位设备。它还可以用于 ARM 设备,[如树莓派][3],它们每天都在变得更加强大和有用。
|
||||
|
||||
![Fedora Media Writer main screen][4]
|
||||
|
||||
(Sumantro Mukherjee, [CC BY-SA 4.0][5])
|
||||
|
||||
### 安装 Fedora Media Writer
|
||||
|
||||
你有几种方式来[安装 Fedora Media Writer][6]。你可以在 GitHub 上[从源码编译][7]、下载 MacOS 或 Windows 版本、使用 **dnf** 或 **yum** 安装 RPM 包、或者以 Flatpak 的形式获得。
|
||||
|
||||
在 Fedora 上:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install mediawriter`
|
||||
```
|
||||
|
||||
最新版本请参见 GitHub 仓库的[发布][8]部分。
|
||||
|
||||
### 准备好你的媒体
|
||||
|
||||
首先,你需要一个 USB 驱动器来安装你的 Linux 操作系统。这就是 Fedora Media Writer 要烧录的东西。这个驱动器必须是空白或可擦除的,因为 **USB 驱动器上的所有数据都会被删除**。如果有任何数据,哪怕只是一个文件,如果你不想丢失,那么你必须在继续之前备份它!
|
||||
|
||||
确认你的 U 盘是可擦除的后,将它插入你的电脑并启动 Fedora Media Writer。
|
||||
|
||||
### 使用 Fedora Media Writer
|
||||
|
||||
当你启动 Fedora Media Writer 时,你会看到一个页面,提示你从互联网上获取一个可引导的镜像,或者从你的硬盘上加载一个自定义镜像。第一个选择是 Fedora 的最新版本。工作站版适用于台式机和笔记本电脑,服务器版适用于虚拟化、机架服务器或任何你想作为服务器运行的情况。
|
||||
|
||||
如果你选择了 Fedora 镜像,Media Writer 会下载一个光盘镜像(通常称为 ”iso“,文件扩展名为 **.iso**),并将其保存到你的 `Downloads` 文件夹中,这样你就可以重复使用它来烧录另一个驱动器。
|
||||
|
||||
![Select your image][9]
|
||||
|
||||
另外还有 Fedora Spins,这是来自 Fedora 社区的镜像,它旨在满足小众的兴趣。例如,如果你是 [MATE 桌面][10]的粉丝,那么你会很高兴地发现 Media Writer 提供的 MATE ”spin“。它有很多选择,所以请滚动查看所有的。如果你是 Linux 的新手,不要被吓到或困惑:额外的选项是为长期用户准备的,这些用户除了默认的选项外,还发展出了自己的偏好,所以对你来说,只使用工作站或服务器选项是安全的,这取决于你是想把 Fedora 作为一个桌面还是作为一个服务器操作系统来运行。
|
||||
|
||||
如果你需要一个与你当前使用的 CPU 不同的镜像,从窗口右上角的下拉菜单中选择 CPU 架构。
|
||||
|
||||
如果你已经将镜像保存在硬盘上,请选择**自定义映像**选项,并选择你要烧录到 USB 的发行版的 **.iso** 文件。
|
||||
|
||||
### 写入 USB 驱动器
|
||||
|
||||
当你下载或选择了一个镜像,你必须确认你要将该镜像写入驱动器。
|
||||
|
||||
驱动器选择下拉菜单只显示外部驱动器,所以你不会意外地覆盖自己的硬盘驱动器。这是 Fedora Media Writer 的一个重要功能,它比你在网上看到的许多手动说明要安全得多。然而,如果你的计算机上连接了多个外部驱动器,除了你想覆盖的那个,你应该将它们全部移除,以增加安全性。
|
||||
|
||||
选择你要安装镜像的驱动器,然后单击**写入磁盘**按钮。
|
||||
|
||||
![Media write][11]
|
||||
|
||||
|
||||
|
||||
等一会儿镜像被写入你的驱动器,然后查看 Don Watkins 对[如何从 USB 驱动器启动到 Linux][12]的出色概述 。
|
||||
|
||||
### 开始使用 Linux
|
||||
|
||||
Fedora Media Writer 是一种将 Fedora Workstation 或 Server,或任何 Linux 发行版烧录到 USB 驱动器的方法,因此你可以在设备安装它之前试用它。试试吧,并在评论中分享你的经验和问题。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/10/fedora-media-writer
|
||||
|
||||
作者:[Sumantro Mukherjee][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://opensource.com/users/sumantro
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/usb-hardware.png?itok=ROPtNZ5V (Multiple USB plugs in different colors)
|
||||
[2]: https://github.com/FedoraQt/MediaWriter
|
||||
[3]: https://fedoraproject.org/wiki/Architectures/ARM/Raspberry_Pi
|
||||
[4]: https://opensource.com/sites/default/files/uploads/fmw_mainscreen.png (Fedora Media Writer main screen)
|
||||
[5]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[6]: https://docs.fedoraproject.org/en-US/fedora/f32/install-guide/install/Preparing_for_Installation/#_fedora_media_writer
|
||||
[7]: https://github.com/FedoraQt/MediaWriter#building
|
||||
[8]: https://github.com/FedoraQt/MediaWriter/releases
|
||||
[9]: https://opensource.com/sites/default/files/mediawriter-image.png
|
||||
[10]: https://opensource.com/article/19/12/mate-linux-desktop
|
||||
[11]: https://opensource.com/sites/default/files/mediawriter-write.png (Media write)
|
||||
[12]: https://opensource.com/article/20/4/first-linux-computer
|
Loading…
Reference in New Issue
Block a user