Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2020-06-03 10:47:26 +08:00
commit 30550968df
6 changed files with 249 additions and 250 deletions

View File

@ -1,8 +1,8 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12276-1.html)
[#]: subject: (How to manage network services with firewall-cmd)
[#]: via: (https://fedoramagazine.org/how-to-manage-network-services-with-firewall-cmd/)
[#]: author: (dan01 https://fedoramagazine.org/author/dan01/)
@ -10,7 +10,7 @@
如何使用 firewall-cmd 管理网络服务
======
![][1]
![](https://img.linux.net.cn/data/attachment/album/202006/03/090806hcmc9cxcbbcuccbe.jpg)
在上一篇文章中,我们探讨了如何在 Fedora 中[用命令行控制防火墙][2]。
@ -18,15 +18,15 @@
### 简短回顾
首先,最好检查一下防火墙的_状态_看它是否正在运行。如我们先前所学你可以使用状态选项_firewall-cmd_ _state_来执行
首先,最好检查一下防火墙的*状态*,看它是否正在运行。如我们先前所学,你可以使用状态选项(`firewall-cmd state`)来得到
下一步是获取所需网络接口的区域。例如我使用的桌面有两个网络接口一个_物理_接口_enp0s3_代表我实际的_网卡_和_虚拟_接口_virbr0_它被 _KVM_ 等虚拟化软件使用。要查看哪些区域处于活动状态,请运行 _firewall-cmd get-active-zones_
下一步是获取网络接口适用的<ruby><rt>zone</rt></ruby>。例如,我使用的桌面有两个网络接口:一个*物理*接口(`enp0s3`),代表我实际的*网卡*,和*虚拟*接口(`virbr0`),它由 KVM 等虚拟化软件使用。要查看哪些域处于活动状态,请运行 `firewall-cmd get-active-zones`
现在,你知道了你感兴趣的区域,可以使用 _firewall-cmd -info-zone = FedoraWorkstation_ 列出该区域的规则。
现在,你知道了你感兴趣的域,可以使用 `firewall-cmd info-zone=FedoraWorkstation` 这样的命令列出该域的规则。
### 读取区域信息
要显示特定_区域_的信息请运行 _firewall-cmd zone=ZoneName list-all_,或使用以下命令显示默认区域的信息:
要显示*特定域*的信息,请运行 `firewall-cmd zone=ZoneName list-all`,或使用以下命令显示默认域的信息:
```
[dan@localhost ~]$ firewall-cmd --list-all
@ -45,21 +45,23 @@ icmp-blocks:
rich rules:
```
现在,让我们查看输出。第一行表明以下信息关联的_区_以及该域当前是否在使用中。
现在,让我们查看输出。第一行表明以下信息关联的域以及该域当前是否在使用中。
_target_ : _default_ 告诉我们这是默认区域。可以通过 _set-default-zone=ZoneName__get-default-zone_ 设置或获取。
`target: default`:告诉我们这是默认域。可以通过 `set-default-zone=ZoneName``get-default-zone` 设置或获取。
_icmp-block-inversion_ 表明是否阻止 [ICMP][3] 请求。例如,如果机器响应来自网络上其他机器的 _ping_ 请求。 _interfaces_ 字段显示接受此区域的所有接口。
`icmp-block-inversion` 表明是否阻止 [ICMP][3] 请求。例如,如果机器响应来自网络上其他机器的 ping 请求。
`interfaces` 字段显示接受此域的所有接口。
### 处理服务、端口和协议
现在,重点关注 _services _、_ ports_ 和 _protocols_ 所在行。默认情况下,防火墙将阻止所有端口、服务和协议。而只允许列出的。
现在,重点关注 `services`、`ports` 和 `protocols` 所在行。默认情况下,防火墙将阻止所有端口、服务和协议,而只允许列出的。
在这里,你可以看到允许的服务是非常基本的客户端服务。例如,访问网络上的共享文件夹(_samba-client__DNS_ 服务器通信或通过 SSH_ssh_ 服务)连接到计算机。你可以将 _service_ 视为与端口组合的协议,例如 ssh 服务使用 SSH 协议,并且按照惯例使用 22 端口。通过允许 ssh 服务,你实际上所做的就是允许传入的连接在默认 22 端口上使用 ssh 协议。
在这里,你可以看到允许的服务是非常基本的客户端服务。例如,访问网络上的共享文件夹(`samba-client`)、与 DNS 服务器通信或通过 SSH`ssh` 服务)连接到计算机。你可以将 `service` 视为与端口组合的协议,例如 `ssh` 服务使用 SSH 协议,并且按照惯例使用 22 端口。通过允许 `ssh` 服务,你实际上所做的就是允许传入的连接在默认 22 端口上使用 SSH 协议。
请注意,根据经验,名称中带有 _client_ 字样的服务是指传出连接,也就是你使用你的 IP 作为源与外部_连接_与之相反的是 **SSH** 服务,比如,它将接受传入连接(监听你外部的连接)。
请注意,根据经验,名称中带有 `client` 字样的服务是指传出连接,也就是你使用你的 IP 作为源对外部的*连接*,与之相反的是 `ssh` 服务,比如,它将接受传入连接(监听来自外部的连接)。
你可以在文件 _/etc/services_ 中查找服务。例如,如果你想知道这些服务使用什么端口和协议:
你可以在文件 `/etc/services` 中查找服务。例如,如果你想知道这些服务使用什么端口和协议:
```
[dan@localhost ~]$ cat /etc/services | grep ssh
@ -67,19 +69,19 @@ ssh 22/tcp # The Secure Shell (SSH) Protocol
ssh 22/udp # The Secure Shell (SSH) Protocol
```
你可以看到 SSH 同时使用 TCP 和 UDP 的 22 端口。此外,如果你希望查看所有可用的服务,只需使用 _firewall-cmd -get-services_
你可以看到 SSH 同时使用 TCP 和 UDP 的 22 端口。此外,如果你希望查看所有可用的服务,只需使用 `firewall-cmd --get-services`
#### 打开端口
如果要阻止端口、服务或协议,请确保在此处未列出它们。 扩展一下,如果要允许服务,那么需要将它添加到列表中。
如果要阻止端口、服务或协议,请确保在此处未列出它们。展开来说,如果要允许服务,那么需要将它添加到列表中。
假设你要打开 _5000_ 端口用于 _TCP_ 连接。 为此,请运行:
假设你要打开 `5000` 端口用于 TCP 连接。为此,请运行:
```
sudo firewall-cmd --zone=FedorwaWorkstation --permanent --add-port=5000/tcp
```
请注意,你需要指定规则适用的域。添加规则时,还需要如上指定它是 _TCP_ 还是 _UDP_ 端口。_permanent_ 参数将规则设置为即使系统重启后也可以保留。
请注意,你需要指定规则适用的域。添加规则时,还需要如上指定它是 `tcp` 还是 `udp` 端口。`--permanent` 参数将规则设置为即使系统重启后也可以保留。
再次查看你所在区域的信息:
@ -106,11 +108,7 @@ rich rules:
sudo firewall-cmd --zone=FedorwaWorkstation --permanent --remove-port=5000/tcp
```
相同的 _remove_ _remove-protocol_, _remove-service__add_ _add-protocol_, _add-service_选项同样适用于_服务_和_协议_。
* * *
_照片由 [T. Kaiser][4] 拍摄,发布于[Unsplash][5]_
相同的 `remove` `remove-protocol`、`remove-service``add``add-protocol`、`add-service`)选项同样适用于*服务*和*协议*。
--------------------------------------------------------------------------------
@ -119,14 +117,14 @@ via: https://fedoramagazine.org/how-to-manage-network-services-with-firewall-cmd
作者:[dan01][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/) 荣誉推出
[a]: https://fedoramagazine.org/author/dan01/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2020/05/services-firewall-cmd-816x345.jpg
[2]: https://fedoramagazine.org/control-the-firewall-at-the-command-line/
[2]: https://linux.cn/article-12103-1.html
[3]: https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol
[4]: https://unsplash.com/@tkaiser?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[5]: https://unsplash.com/s/photos/poke-hole?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,97 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (robsean)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Make a GIF in GIMP [Simple Tutorial])
[#]: via: (https://itsfoss.com/make-gif-in-gimp/)
[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/)
How to Make a GIF in GIMP [Simple Tutorial]
======
Making a GIF can be fun and many users would like to know how to make one. You can create a GIF very easily with [GIMP][1], the powerful open-source image editing software.
In this GIMP tutorial, Ill show you how to create a simple GIF in GIMP.
### Making a GIF in GIMP
![][2]
Using GIMP as an animation tool requires you to think of every layer as of an animation frame. In this tutorial, I will create a simple web banner based on Its FOSS logo. I will use 2 images as my layers but feel free to add more when you make your own.
The method that I use here is called “the **combine** method”, in which the new frame is added to the previous frame. My idea is to make a “flashing” web banner, to draw the attention at something important.
I presume that you have [already installed GIMP in Ubuntu][3] or whichever operating system you are using. Lets start making the GIF.
#### Step 1
From the File menu, click on **Open as Layers** and select all the images you want to include in the GIF. Then click **Open**.
![][4]
You can order your images in the layers tab. The GIF sequence will start with your bottom layer and run through each layer bottom to top.
![Change the order of layers][5]
From the main menu select **Filters**, then **Animation** and finally click **Optimise (for GIF)**.
![][6]
What “Optimise” does?
Optimise examines each layer, and reuses information from previous frames if they havent changed at the following frame. It only stores new values for pixels that change, and purges any duplicate parts.
If a frame is exactly the same as the previous one, it removes that frame completely and the previous frame just stays on the screen for longer.
To view GIF, from main menu click on **Filter** then **Animation** and **Playback**.
![][7]
Press the **Playback** button to start GIF. To save GIF on the File Menu select **File**, click on **Export as**.
![][8]
Name your GIF and choose the folder you want to save it in. On “**Select File Type**“, choose GIF Image.
![Save As Gif][9]
When prompted select As Animation, Loop Forever, set the desired delay value and to take effect click on “Use delay entered above for all frames”.
The most important option is to set the frame disposal action as “**Cumulative layers (combine)**” to get the “**flashing**” effect for our banner. Click Export as a final step.
![Gif Export Options][10]
**Your GIF is ready!**
![][11]
This was an easy-to-follow, simple example, although GIMP has a much greater depth in animation creating and requires a good amount of study and practice to master it.
If you are interested in more GIMP tutorials, you may read how to outline text in GIMP. Stay tuned at Its FOSS for more such useful tips in the future. [Subscribing to the weekly newsletter][12] is the best way to stay updated. Enjoy!
--------------------------------------------------------------------------------
via: https://itsfoss.com/make-gif-in-gimp/
作者:[Dimitrios Savvopoulos][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://itsfoss.com/author/dimitrios/
[b]: https://github.com/lujun9972
[1]: https://www.gimp.org/
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/create-gif-in-gimp.jpg?ssl=1
[3]: https://itsfoss.com/gimp-2-10-release/
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/1.-open-as-layers.jpeg?ssl=1
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/layers-order.jpg?ssl=1
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/2.-optimize-for-gif-1.png?fit=800%2C647&ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/3.-playback.png?fit=800%2C692&ssl=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/4.-export-as.png?ssl=1
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/5.-save-as-gif.png?fit=800%2C677&ssl=1
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/6.-export-options-1.png?ssl=1
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/its-foss-logo.gif?fit=800%2C417&ssl=1
[12]: https://itsfoss.com/subscribe-to-newsletter/

View File

@ -1,126 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Format a USB Disk as exFAT on Linux [Graphically and Command Line])
[#]: via: (https://itsfoss.com/format-exfat-linux/)
[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/)
How to Format a USB Disk as exFAT on Linux [Graphically and Command Line]
======
_**Brief: This tutorial teaches you how to format a USB disk in exFAT format on Linux systems. Both GUI and command line methods have been discussed.**_
For a long time [FAT][1] has been the default choice of filesystem for formatting disks. It is compatible with pretty much all the major operating systems.
The one major problem with FAT filesystem is that you cannot transfer a file larger than 4 GB. This means even if your USB disk has 32 GB of free space, if you try to transfer a ISO image or some other file greater than 4 GB in size, the transfer will fail.
This creates a problem in situation like when you are [creating a bootable USB of Windows in Linux][2]. You cannot use [NTFS][3] and FAT filesystem has that 4 GB size restrictions.
To overcome the limitations of FAT filesystem, Microsoft came up with [exFAT filesystem][4]. And in this tutorial, Ill show you how to format a USB disk in exFAT filesystem.
* [Format disk as exFAT using graphical tool][5]
* [Format disk as exFAT using command line][6]
P**rerequisite**
Starting [Linux kernel 5.4][7], exFAT filesystem support is enabled in Linux kernel itself. [Check which Linux kernel version you are running][8]. If it is kernel 5.4 or higher, you should be fine.
Otherwise, youll have to [enable exFAT support][9] explicitly. In Ubuntu-based distributions, you can use these packages for this purpose:
**sudo apt install exfat-fuse exfat-utils**
### Method 1: Format disk as exFAT using GNOME Disks tool
![][10]
Formatting a drive using [GNOME Disks][11] is a straightforward job. It comes preinstalled in a number of Linux distributions.
Plug in your external USB disk. Now, look for Disks in menu and open the GNOME Disks application. As a first step choose the drive that you want to format and follow the steps with me.
_**Warning: Pay attention to the disk you are selecting to format. Dont format your main disk accidentally.**_
![][12]
The commonly used file systems like Ext4, NTFS, FAT will appear first. To use exFAT, choose “**Other**” and then click on “**Next**“.
![][13]
Final step: choose exFAT file system on this screen and then click **Create**. Job done!
![][14]
See how easy it was to create a exFAT disk in Linux graphically? Now, let me show you the terminal method as well.
### Method 2: Format disk as exFAT in Linux command line (for advanced users)
[fdisk][15] is a dialogue-driven command-line utility that creates and manipulates partition tables and partitions on a hard disk. In fact, it is considered one of the [best partitioning tools for Linux][16].
Plug in your external hard disk then type the following command in the terminal:
```
sudo fdisk -l
```
![][17]
This will list down all the hard disks and partitions in your computer. Identify the partition that you want to format in your external hard disk. Size of the disks should give you a hint. For me, the USB disk was labelled as /dev/sdb1.
Once you have identified your USB disk, format it as exfat using the command below. Replace /dev/sdXn with your disks device ID. LABEL is basically the name you want to give to your disk like Data, MyUSB etc.
```
sudo mkfs.exfat -n LABEL /dev/sdXn
```
![][18]
Optionally, run fsck check to make sure the formatting has been done properly.
```
sudo fsck.exfat /dev/sdXn
```
Thats it. Enjoy the exFAT disk.
### Did you succeed to create exFAT disk?
I hope you find this tutorial simple enough, and a step forward to build a solid partitioning knowledge foundation.
Sometimes easy and simple tips and tricks will make you a better Linux in the long term. Our frequent readers know that first hand but if you discovered Its FOSS recently, you may take the opportunity to explore our handy tutorials.
Dont forget to subscribe and let me know your questions and suggestions in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/format-exfat-linux/
作者:[Dimitrios Savvopoulos][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://itsfoss.com/author/dimitrios/
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/File_Allocation_Table
[2]: https://itsfoss.com/bootable-windows-usb-linux/
[3]: https://en.wikipedia.org/wiki/NTFS
[4]: https://en.wikipedia.org/wiki/ExFAT
[5]: tmp.YPwoWNgq9W#graphical-method
[6]: tmp.YPwoWNgq9W#command-line
[7]: https://itsfoss.com/linux-kernel-5-4/
[8]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/
[9]: https://itsfoss.com/mount-exfat/
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/format-exfat-linux.jpg?ssl=1
[11]: https://wiki.gnome.org/Apps/Disks
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/1.-gnome-disks-2.png?ssl=1
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/2.-gnome-disks.jpg?ssl=1
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/3.-gnome-disks.jpg?ssl=1
[15]: https://www.tldp.org/HOWTO/Partition/fdisk_partitioning.html
[16]: https://itsfoss.com/partition-managers-linux/
[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/sudo-fdisk-l-1.jpg?ssl=1
[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/sdXn.jpg?ssl=1

View File

@ -0,0 +1,97 @@
[#]: collector: (lujun9972)
[#]: translator: (robsean)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Make a GIF in GIMP [Simple Tutorial])
[#]: via: (https://itsfoss.com/make-gif-in-gimp/)
[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/)
如何在 GIMP 中制作 GIF [简单教程]
======
制作一个 GIF 可能是一件很有趣的事,很多用户可能都想如何制作一个 GIF 。你可以使用 [GIMP][1] 创建一个非常简单的 GIFGIMP 是功能强大的开放源码的图像编辑软件。
在这篇 GIMP 教程中,我将向你展示然后在 GIMP 中创建一个简单的 GIF 。
### 在 GIMP 中制作一个 GIF
![][2]
使用 GIMP 作为一个动画制作工具需要你把每个图层都看作动画的一幅帧。在这篇教程中,我将创建一个简单的基于 FOSS 标志的网页横幅。我将使用2个图像作为我的图层但当你制作你自己的 GIF 时,你可以随意添加更多的图像。
我在这里使用的方法叫做 “ **组合** 法”,在这个方法中,新的帧被添加到先前的帧中。我的想法是制作一个“频闪”的网页横幅,来在一些重要的事情上引起注意。
我假设你已经 [在 Ubuntu 中安装了 GIMP ][3] ,或者在任何一个你正在使用的操作系统中安装了 GIMP 。让我们开始制作 GIF 。
#### 步骤 1
从文件菜单中,单击 **作为图层打开** ,并选择你想包含在 GIF 中是所有图像。然后单击 **打开**
![][4]
你可以排序在图层标签页中的图像。GIF 一系列的帧将从最下面的图层开始,从下到上运行每一层图层。
![更改图层的顺序][5]
从主菜单中选择 **滤镜** ,接着选择 **动画** ,最后单击 **优化 (对 GIF)**.
![][6]
“优化” 做什么?
优化,检查每一层,如果来自前一帧的信息在下一帧中没有改变,则重复使用这些信息。它只存储新更改的像素值,并清除任何重复的部分。
如果一幅帧与前一幅帧完全相同,那么它将完全删除这一幅帧,并且前一幅帧将恰当地在屏幕上停留更长时间。
为查看 GIF ,从主菜单中单击 **滤镜** ,接着单击 **动画****回放**
![][7]
按下 **回放** 按钮来启动 GIF 。为保存 GIF ,在文件菜单上选择 **文件** ,单击 **导出为**.
![][8]
命名你的 GIF ,并选择你想将其保存到的文件夹。在 “**选择文件类型**“ 时,选择 GIF 图像。
![保存为 Gif][9]
当提示时,选择 ‘作为动画’, ‘反复循环’, 设置期望的延迟值,并单击 “上面输入的延迟用于所有帧” 来生效。
最重要的选项是设置帧处理动作为 “**累积各图层(组合)**” ,以便为我们的横幅获取 “**频闪**” 效果。单击导出作为最后一个步骤。
![Gif 导出选项][10]
**你的 GIF 已经准备好了!**
![][11]
这是一个浅显易懂的示例,不过 GIMP 在动画创作方面有很大的难度,需要大量的学习和实践才能掌握它。
如果你对更多的 GIMP 教程感兴趣,你可以阅读在 GIMP 中的如何做概述文本。请继续关注 FOSS ,以便在未来获得更多有用的提示。 [订阅每周简讯][12] 是保持更新的最好方式。享受吧!
--------------------------------------------------------------------------------
via: https://itsfoss.com/make-gif-in-gimp/
作者:[Dimitrios Savvopoulos][a]
选题:[lujun9972][b]
译者:[robsean](https://github.com/robsean)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/dimitrios/
[b]: https://github.com/lujun9972
[1]: https://www.gimp.org/
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/create-gif-in-gimp.jpg?ssl=1
[3]: https://itsfoss.com/gimp-2-10-release/
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/1.-open-as-layers.jpeg?ssl=1
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/layers-order.jpg?ssl=1
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/2.-optimize-for-gif-1.png?fit=800%2C647&ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/3.-playback.png?fit=800%2C692&ssl=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/4.-export-as.png?ssl=1
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/5.-save-as-gif.png?fit=800%2C677&ssl=1
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/6.-export-options-1.png?ssl=1
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/its-foss-logo.gif?fit=800%2C417&ssl=1
[12]: https://itsfoss.com/subscribe-to-newsletter/

View File

@ -0,0 +1,127 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Format a USB Disk as exFAT on Linux [Graphically and Command Line])
[#]: via: (https://itsfoss.com/format-exfat-linux/)
[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/)
如何在 Linux 上将 USB 盘格式化为 exFAT (图形和命令行)
======
_**简介:本教程教你如何在 Linux 系统上以 exFAT 格式格式化 USB 盘。同时包括 GUI 和命令行方法。**_
长期以来,[FAT][1]是用于格式化磁盘文件系统的默认选择。它与几乎所有主要操作系统兼容。
FAT 文件系统的一个主要问题是你不能传输大于 4GB 的文件。这意味着即使你的 USB 盘有 32GB 的可用空间,如果你尝试传输 ISO 镜像或其他大于 4GB 的文件,传输也会失败。
这会[在 Linux 中创建 Windows 的可启动 USB 盘][2]的情况下造成问题。你不能使用 [NTFS][3],并且 FAT 文件系统有 4GB 的大小限制。
为了克服 FAT 文件系统的限制Microsoft 推出了 [exFAT 文件系统][4]。在本教程中,我将向你展示如何使用 exFAT 文件系统中格式化 USB 盘。
* [使用图形工具将磁盘格式化为 exFAT][5]
  * [使用命令行将磁盘格式化为 exFAT][6]
**先决条件**
从 [Linux kernel 5.4][7] 开始Linux 内核本身中启用了 exFAT 文件系统支持。[检查正在运行的 Linux 内核版本][8]。如果它是内核 5.4 或更高版本,那么应该没问题。
不然,你必须[启用 exFAT 支持][9]。在基于 Ubuntu 的发行版中,你可以安装以下软件包:
**sudo apt install exfat-fuse exfat-utils**
### 方法 1使用 GNOME 磁盘工具将磁盘格式化为 exFAT
![][10]
使用 [GNOME 磁盘][11]格式化驱动器是一项简单的工作。它预装在许多 Linux 发行版中。
插入外部 USB 盘。在菜单中查找 “Disk”然后打开 “GNOME Disks” 应用。第一步,选择要格式化的驱动器,然后按照我的步骤操作。
_**警告:请注意你要选择格式化的磁盘。请勿意外格式化主磁盘。**_
![][12]
诸如 Ext4、NTFS、FAT 之类的常用文件系统将首先出现。要使用 exFAT请选择 “**Other**”,然后单击 “**Next**”。
![][13]
最后一步:在此页面上选择 exFAT 文件系统,然后单击 “Create”。完成了
![][14]
看到在 Linux 中以图形方式创建 exFAT 磁盘有多么容易了吧?现在,让我也向你展示终端方法。
### 方法 2在 Linux 命令行中将磁盘格式化为 exFAT适用于高级用户
[fdisk][15] 是一个交互式命令行程序,它可在硬盘上创建和操作分区表和分区。实际上,它被认为是 [Linux 最佳分区工具][16]之一。
插入外部硬盘,然后在终端中输入以下命令:
```
sudo fdisk -l
```
![][17]
这将列出计算机中的所有硬盘和分区。识别出要在外部硬盘上格式化的分区。应该会提示磁盘大小。对我而言USB 盘被标记为 /dev/sdb1。
识别出 USB 盘后,请使用以下命令将它格式化为 exfat。将 /dev/sdXn 替换为你的磁盘 ID。LABEL 是你要为磁盘命名的名称,例如 Data、MyUSB 等。
```
sudo mkfs.exfat -n LABEL /dev/sdXn
```
![][18]
可选地,运行 fsck check 以确保格式化正确。
```
sudo fsck.exfat /dev/sdXn
```
就是这样。享受 exFAT 盘吧。
### 你是否成功创建了exFAT 盘?
我希望你觉得本教程足够简单,并建立坚实的分区知识基础的第一步。
从长远来看,有时简单易用的技巧将让你有一个更好的 Linux。我们的常客会第一时间知道这些但如果你最近才发现 Its FOSS你可以借此机会了解我们方便的教程。
别忘了订阅,并在下面的评论中让我知道你的问题和建议。
--------------------------------------------------------------------------------
via: https://itsfoss.com/format-exfat-linux/
作者:[Dimitrios Savvopoulos][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/dimitrios/
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/File_Allocation_Table
[2]: https://itsfoss.com/bootable-windows-usb-linux/
[3]: https://en.wikipedia.org/wiki/NTFS
[4]: https://en.wikipedia.org/wiki/ExFAT
[5]: tmp.YPwoWNgq9W#graphical-method
[6]: tmp.YPwoWNgq9W#command-line
[7]: https://itsfoss.com/linux-kernel-5-4/
[8]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/
[9]: https://itsfoss.com/mount-exfat/
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/format-exfat-linux.jpg?ssl=1
[11]: https://wiki.gnome.org/Apps/Disks
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/1.-gnome-disks-2.png?ssl=1
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/2.-gnome-disks.jpg?ssl=1
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/3.-gnome-disks.jpg?ssl=1
[15]: https://www.tldp.org/HOWTO/Partition/fdisk_partitioning.html
[16]: https://itsfoss.com/partition-managers-linux/
[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/sudo-fdisk-l-1.jpg?ssl=1
[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/sdXn.jpg?ssl=1