如何在 Linux 中使用 Toggle SE Linux 进行更好的系统保护? (toggle se linux)

在当今互联网时代,保证系统安全已经变成了重中之重,Linux 操作系统是更受欢迎的开源操作系统之一,众所周知,这个广泛应用在服务器环境中的开源操作系统,能够提供独特的功能和灵活性。然而,开放源代码也意味着安全威胁可能影响到您的系统。为了保证您的Linux 系统安全,在使用系统时需要采取一些措施来确保所使用的系统能够得到完整保护。其中 Toggle SELinux 等一些工具是值得我们去使用的,接下来我们就一起学习如何在 Linux 中使用 Toggle SELinux 进行更为优秀的系统保护。

一、什么是 Toggle SELinux?

Toggle SELinux 是一个开源工具,它允许用户在命令行中快速地启用或禁用 SELinux,SE Linux 是一个功能强大的安全子系统,它得到了 Linux 内核的非常好的支持,它通过访问控制权限来限制应用程序或其他进程与操作系统或其他进程之间的交互,进而确保系统的安全性。

二、如何安装 Toggle SELinux?

1.在终端中使用命令sudo apt-get install selinux-utils进行 SELinux 安装。

2.使用以下命令查看 SELinux 是否成功安装:

$ sudo cat /selinux/enforce

$ sudo getenforce

如安装成功,将会看到“Enforcing”或“Permissive”。

$ sudo cat /selinux/enforce

Enforcing

$ sudo getenforce

Enforcing

三、如何使用 Toggle SELinux?

1.使用以下命令查看 SELinux 是否当前被禁用:

$ sestatus

配置文件身份证验证需要您更改密码:

The passwd file needs updating on behalf of

your admin account. Make the change yourself

or contact a privileged administrator.

SELinux status: disabled

2.使用以下命令启用 SELinux:

$ sudo setenforce 1

通过以上命令,SELinux 将会被立即启用,并且在每次重启后都会保留。

3.使用以下命令禁用 SELinux:

$ sudo setenforce 0

通过以上命令,SELinux 将会被立即禁用,并且在每次重启后都会保留。

四、使用 Toggle SELinux 的好处

1.全部自动化。

一个用户可以使用 Toggle SELinux,通过更快捷可靠的自动工具来帮助您启用或禁用 SELinux。

2.保证操作的正确性。

在命令行中启用 SELinux 或关闭时,可能会发生一些错误。但是使用 Toggle SELinux,您可以避免有人误操作,从而确保操作的正确性。

3.提高操作效率。

在屏幕上查找命令以启用或禁用 SELinux 可能比在命令行或其他位置中查找要耗费更多时间。使用 Toggle SELinux,您不需要在命令行或其他位置上进行单独搜索,从而可以提高操作效率。

在 Linux 系统中使用 Toggle SELinux 工具可以让您更好地保护您的系统,并且可以使您的操作更加流畅和高效。请尝试使用这些工具,以更加充分地利用您的 Linux 系统,并且确保您的系统运行得更加平稳和安全。

相关问题拓展阅读:

Linux磁盘管理

是一个创建和维护分区表的程序,它兼容DOS类型的分区表、BSD或者SUN类型的磁盘列表。

语法

fdisk

必要参数:

-l 列出素所有分区表

-u 与”-l”搭配使用,显示分区数目

选择参数:

-s 指定分区

-v 版本信息

菜单操作说明

m :显示菜单和帮助信息

a :活动分区标记/引导分区

d :删除分区

l :显示分区类型

n :新建分区

p :显示分区信息

q :退出不保存

t :设置分区号

v :进行分区检查

w :保存修改

x :扩展应用,高级功能

(英文全拼:make file system)命令用于在特定的分区上建立 linux 文件系统。

使用方式  :

mkfs filesys

参数  :

device : 预备检查的硬盘分区,例如:/dev/sda1

-V : 详细显示模式

-t : 给定档案系统的型式,Linux 的预设值为 ext2

-c : 在制做档案系统前,检查该partition 是否有坏轨

-l bad_blocks_file : 将有坏轨的block资料加到 bad_blocks_file 里面

block : 给定 block 的大小

命令是经常会使用到的命令,它用于挂载Linux系统仔首袜外的文件。

语法

mount mount -a mount > device | dir

mount device dir

参数说明:

-V:显示程序版本

-h:显示辅助讯息

-v:显示较讯息,通常和 -f 用来除错。

-a:将 /etc/fstab 中定义的所有档案系统挂上。

-F:这个命令通常和 -a 一起使用,它会为每一个 mount 的动作产生一个行程负责执行。在系统需要挂上大量 NFS 档案系统时可以加快挂上的动作。

-f:通常用在除错的用途。它会使 mount 并不执行实际挂上的动作,而念激是模拟整个挂上的过程。通常会和 -v 一起使用。

-n:一般而芹拆言,mount 在挂上后会在 /etc/mtab 中写入一笔资料。但在系统中没有可写入档案系统存在的情况下可以用这个选项取消这个动作。

-s-r:等于 -o ro

-w:等于 -o rw

-L:将含有特定标签的硬盘分割挂上。

-U:将档案分割序号为 的档案系统挂下。-L 和 -U 必须在/proc/partition 这种档案存在时才有意义。

-t:指定档案系统的型态,通常不必指定。mount 会自动选择正确的型态。

-o async:打开非同步模式,所有的档案读写动作都会用非同步模式执行。

-o sync:在同步模式下执行。

-o atime、-o noatime:当 atime 打开时,系统会在每次读取档案时更新档案的『上一次调用时间』。当我们使用 flash 档案系统时可能会选项把这个选项关闭以减少写入的次数。

-o auto、-o noauto:打开/关闭自动挂上模式。

-o defaults:使用预设的选项 rw, suid, dev, exec, auto, nouser, and async.

-o dev、-o nodev-o exec、-o noexec允许执行档被执行。

-o suid、-o nosuid:

允许执行档在 root 权限下执行。

-o user、-o nouser:使用者可以执行 mount/umount 的动作。

-o remount:将一个已经挂下的档案系统重新用不同的方式挂上。例如原先是唯读的系统,现在用可读写的模式重新挂上。

-o ro:用唯读模式挂上。

-o rw:用可读写模式挂上。

-o loop=:使用 loop 模式用来将一个档案当成硬盘分割挂上系统。

(base) zfy@zfy-PC:~$ sudo fdisk -l

Disk /dev/sda: 80 GiB,bytes,sectors

#块设备名称为/dev/sda,此设备的大小为80 GB,bytes是转换成字节后的大小,共个扇区

Disk model: VMware Virtual S

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: 0x3b1ffeba

Device    Boot    StartEnd  Sectors  Size Id Type

#分区序列 | 引导 | 开始 | 终止 | Sectors | 容量 | 分区类型ID | 分区类型

/dev/sda1  *.5G 83 Linux

/dev/sda.5G  5 Extended

/dev/sdaG 83 Linux

/dev/sdaG 82 Linux swap / Solaris

/dev/sdaG 83 Linux

/dev/sdaG 83 Linux

/dev/sda.5G 83 Linux

Partition table entries are not in disk order.

a. 在虚拟机中添加硬盘,添加后使用fdisk -l命令查看,磁盘变成两个,在sda中还没有分区

root@zfy-PC:/home/zfy# fdisk -l

Disk /dev/sda: 2 GiB,bytes,sectors

Disk model: VMware Virtual S

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 /dev/sdb: 80 GiB,bytes,sectors

Disk model: VMware Virtual S

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: 0x3b1ffeba

Device    Boot    StartEnd  Sectors  Size Id Type

/dev/sdb1  *.5G 83 Linux

/dev/sdb.5G  5 Extended

/dev/sdbG 83 Linux

/dev/sdbG 82 Linux swap / Solaris

/dev/sdbG 83 Linux

/dev/sdbG 83 Linux

/dev/sdb.5G 83 Linux

Partition table entries are not in disk order.

b.下面对sda进行分区

root@zfy-PC:/home/zfy# fdisk /dev/sda

Welcome to fdisk (util-linux 2.33.1). 

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

Device does not contain a recognized partition table.

Created a new DOS disklabel with disk identifier 0xb985e226.

Command (m for help): m

#输入m查看帮助

Help:

  DOS (MBR)

  a  toggle a bootable flag

  b  edit nested BSD disklabel

  c  toggle the dos compatibility flag

  Generic

  d  delete a partition

  F  list free unpartitioned space

  l  list known partition types

  n  add a new partition

  p  print the partition table

  t  change a partition type

  v  verify the partition table

  i  print information about a partition

  Misc

  m  print this menu

  u  change display/entry units

  x  extra functionality (experts only)

  Script

  I  load disk layout from sfdisk script file

  O  dump disk layout to sfdisk script file

  Save & Exit

  w  write table to disk and exit

  q  quit without saving changes

  Create a new label

  g  create a new empty GPT partition table

  G  create a new empty SGI (IRIX) partition table

  o  create a new empty DOS partition table

  s  create a new empty Sun partition table

Command (m for help): n

#输入n创建一个分区

Partition type

  p  primary (0 primary, 0 extended, 4 free)

  e  extended (container for logical partitions)

Select (default p): p

#选择主分区

Partition number (1-4, default 1): 1

#选择编号为1

First sector (, default 2023):

#起始sector 设为

Last sector, +/-sectors or +/-size{K,M,G,T,P} (3, default):

#终止sector 设为

Created a new partition 1 of type ‘Linux’ and of size 827.3 MiB.

#分区完成,分区大小为827.3 MiB

Command (m for help): n

#继续创建一个分区

Partition type

  p  primary (1 primary, 0 extended, 3 free)

  e  extended (container for logical partitions)

Select (default p): e

#新增扩展分区

Partition number (2-4, default 2): 2

#选择编号为2

First sector (, default 2023): 2023

#起始sector为2023

Last sector, +/-sectors or +/-size{K,M,G,T,P} (, default):

#终止sector为

Created a new partition 2 of type ‘Extended’ and of size 1.2 GiB.

#新增完成,大小为1.2GiB

Command (m for help): w

#保存

The partition table has been altered.

Calling ioctl() to re-read partition table.

Syncing disks.

c.查看分区后磁盘信息,此时sda磁盘已经有两个分区

Disk /dev/sda: 2 GiB,bytes,sectors

Disk model: VMware Virtual S

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: 0xb985e226

Device    Boot  Start    End Sectors  Size Id Type

/dev/sda.3M 83 Linux

/dev/sda.2G  5 Extended

Partition table entries are not in disk order.

Disk /dev/sdb: 80 GiB,bytes,sectors

Disk model: VMware Virtual S

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: 0x3b1ffeba

Device    Boot    StartEnd  Sectors  Size Id Type

/dev/sdb1  *.5G 83 Linux

/dev/sdb.5G  5 Extended

/dev/sdbG 83 Linux

/dev/sdbG 82 Linux swap / Solaris

/dev/sdbG 83 Linux

/dev/sdbG 83 Linux

/dev/sdb.5G 83 Linux

Partition table entries are not in disk order.

d.用ext3的文件系统对分区进行格式化

root@zfy-PC:/home/zfy# mkfs -t ext3 /dev/sda1

mke2fs 1.44.5 (15-Dec-2023)

Creating filesystem withk blocks andinodes

Filesystem UUID: dbaf1-4eec-a62d-f2b2f8e0ec96

Superblock backups stored on blocks:

, 98304,

Allocating group tables: done

Writing inode tables: done

Creating journal (4096 blocks): done

Writing superblocks and filesystem accounting information: done

e.新建一个分区目录 /data,并挂载

root@zfy-PC:/home/zfy# mkdir data

root@zfy-PC:/home/zfy# mount /dev/sda1 /data

root@zfy-PC:/home/zfy# df -TH /data/#查看是否挂载成功

文件系统类型  容量  已用  可用 已用% 挂载点

/dev/sdaext3  838M  881k  793M    1% /data

f. 用vim打开 etc/fstab并假如 /dev/sda1/data ext3 defaults 0 0,这样重启后便不需要再挂载

参考文献:

【1】 Linux mount命令 | 菜鸟教程 (runoob.com)

在LINUX系统中,分区与格式化硬盘的命令是什么?

原文地址

在Linux中可以用fdisk和parted来进行分区,然后使用mkfs来格式化硬盘。当然在安装Linux的时候,系统提供了一个图形化的界面来处理磁盘的分区。不过在本文中我们不讨论这个问题,因为在许多资料中我们都可以找到这个方法的使用说明。本文讨论的是在安装完Linux后的分区和格式化的处理。

一、通过fdisk进行硬盘的分区

.首先使用“sfdisk -l”命令查看硬盘信息。在命令窗口中输入该命令后,系统显示了计算机中的所有硬盘的大小。当然除了这个命令外,我们还可使用“sfdisk -s”、“df”、“fdisk -l”等命令,这里就不再一一列举了。

.在命令行中输入“fdisk /dev/hdX”后回车。(/dev/hdX是具体你想进行分区操作的硬盘编号,如“a”表示之一块硬盘,依此类推)。

.进入分区界面后,按M键可以看到相关的帮助。输入N表示建立一个新的分区,之后根据提示选择建立分区的类型,这里我们按下P建立一个主分区。

.接下来是选中分区的区号,在这里有1~4可以选择,本例中选1。然后输入分区的大小,但是这里有一个麻烦的问题,就是在Linux中fdisk是使用柱面来显示硬盘的总量,所以我们必须先输入开始的柱面,然后再输入结束的柱面。可用一个简单的方法用来换算分区大小,如我们有一个80G的硬盘,可在系统要求我们输入开始柱面的时候看到总的柱面是9729,此时可用下列公式来计算每个分区的柱面大小:“分区的大小/总磁盘容量×9729”。在得到这个柱面大小后,我们就可以通过“开始柱面+柱面大小”得到结束的柱面了。

.完成分区大小的设置后我们只要输入W,这样整个分区操作就结束了。最后输入Q退出分区程序。如果你要做多个分区或扩展分区只要重复这些步骤就可以了。

二、通过parted来建立分区

parted命令的使用方法并不复杂,也便于理解。

.在命令窗口中输入“parted /dev/hdX”后回车进入分区界面,我们可用print命令看到硬盘的分区情况和硬盘的大小。

.使用mkpart命令来建立分区,命令如下:

mkpart primary ext

其含义是从磁盘的1024M的位置开始到2023M的位置结束建立一个ext3格式的大小为1024M的主分区。

三、删除分区

不管是fdisk还是parted建立的分区,都可以删除。篇幅所限我们就只说在parted中删除分区的方法了。在图2中每个分区的前面都有一个数字,这个数字就是分区的编号。找到想要删除的分区后输入“rm X”就可以了,其中X就是分区的编号。

四、格式化分区

格式化分区使用mkfs命令,如“/in/mkfs -t ext3 /dev/hdb3”,其含义就是将分区hdb3格式化为EXT3的格式。当然除了EXT格式,还可以格式化为FAT的格式,具体命令如下:

/in/mkfs -t msdos /dev/hdb3

当然如果你安装了多操作系统,那么就可以在Windows中看到这个在Linux中建立的DOS分区了,不过笔者发现在Red Hat Linux中不可以将分区格式化为FAT32,在以后的版本中应该是可以的吧。

五、让硬盘启动自动挂载

例如挂载/dev/hdb1分区到/mnt/hd目录下

用vi编辑/etc/fstab文件,加入如下内容

/dev/dhb/mnt/hdreiserfs defaults

提示:fdisk和parted的参数还有很多,本文中的这些参数是使用最频繁的,有兴趣的朋友可以看看帮助文档。

Linux下常用的分区工具:

fdisk/sfdisk:命令行工具,各种版本和环境都能使用,包含在软件包util-linux中

diskdruid:图形化分区工具,只能在安装REDHAT系统时使用。

之一步:fdisk

# fdisk -l /dev/sdb

Disk /dev/sdb: 254 MB,bytes

8 heads, 61 sectors/track, 1016 cylinders, totalsectors

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 identifier: 0x

Device Boot StartEnd Blocks Id System

# fdisk /dev/sdb

Command (m for help): #在输入上面的命令后会出现左边的提示,输入m就会得到一个帮助菜单,如下:

Command (m for help): m

Command action

a toggle a bootable flag

b edit bsd disklabel

c toggle the dos compatibility flag

d delete a partition

l list known partition types

m print this menu

n add a new partition

o create a new empty DOS partition table

p print the partition table

q quit without saving changes

s create a new empty Sun disklabel

t change a partition’s system id

u change display/entry units

v verify the partition table

w write table to disk and exit

x extra functionality (experts only)

#help虽然是英文的,可都很简单,在这里不再解释。

#现在,我们正式开始分区的操作:

Command (m for help): n #新建分区

Command action

e extended

p primary partition (1-4)

#e/p分别对应扩展分区 /主分区;我们先分四个主分区,每个50M;然后再来增加主分区或扩展分区,看会出现怎样的状况,嘿嘿。

p #分区类型为主分区

Partition number (1-4, default 1): 1 #分区号,在这里我们依次选择1、2、3、4

First sector (, default 2023): #指定分区的起始扇区,一般默认,按enter键即可。

Last sector, +sectors or +size{K,M,G} (, default): +50M #指定分区的终止扇区,根据前面的提示我们可以做出相应的选择+sectors 或 +size{K,M,G}

Command (m for help): p #用p打印出已建好的分区列表

Disk /dev/sdb: 254 MB,bytes

8 heads, 61 sectors/track, 1016 cylinders, totalsectors

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 identifier: 0x

Device Boot StartEnd Blocks Id System

/dev/sdb 83 Linux

#剩下的三个分区的建立操作同上

#分好四个主分区后的情况如下

Command (m for help): p

Disk /dev/sdb: 254 MB,bytes

8 heads, 61 sectors/track, 1016 cylinders, totalsectors

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 identifier: 0x

Device Boot StartEnd Blocks Id System

/dev/sdb 83 Linux

/dev/sdb 83 Linux

/dev/sdb 83 Linux

/dev/sdb+ 83 Linux

#已经建好四个主分区啦,现在我们来看看如果再建主分区或是扩展分区的话会出现怎样的情况:

Command (m for help): n

You must delete some partition and add an extended partition first

#看到了吧,不能再建分区啦!要再建分区的话必须删除some分区,再新建一个扩展分区才行。

#现在,我们删掉一个主分区,来新建扩展分区

Command (m for help): d #删除分区

Partition number (1-4): 4 #选择要删除分区的分区号,我们选第四个

Command (m for help): p #打印,如下,四个分区变成了三个!

Disk /dev/sdb: 254 MB,bytes

8 heads, 61 sectors/track, 1016 cylinders, totalsectors

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 identifier: 0x

Device Boot StartEnd Blocks Id System

/dev/sdb 83 Linux

/dev/sdb 83 Linux

/dev/sdb 83 Linux

#新建一个扩展分区

#如果在没有建满三个主分的区的情况下建立扩展分区,相关选项会有些不同。

Command (m for help): n

Command action

e extended

p primary partition (1-4)

e

Selected partition 4

First sector (, default): #enter,默认

Using default value

Last sector, +sectors or +size{K,M,G} (, default): #enter,默认,使用剩余空间

Using default value

Command (m for help): p

Disk /dev/sdb: 254 MB,bytes

8 heads, 61 sectors/track, 1016 cylinders, totalsectors

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 identifier: 0x

Device Boot StartEnd Blocks Id System

/dev/sdb 83 Linux

/dev/sdb 83 Linux

/dev/sdb 83 Linux

/dev/sdb 5 Extended

#接下来,我们在新建的扩展分区里再新建两个逻辑分区,因为已经有了三个主分区,这里不会再显示是建立逻辑分区还是主分区的提示!

Command (m for help): n

First sector (, default): #enter

Using default value

Last sector, +sectors or +size{K,M,G} (, default): +50M

Command (m for help): n

First sector (, default): #enter

Using default value

Last sector, +sectors or +size{K,M,G} (, default): #enter

Using default value

Command (m for help): p

Disk /dev/sdb: 254 MB,bytes

8 heads, 61 sectors/track, 1016 cylinders, totalsectors

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 identifier: 0x

Device Boot StartEnd Blocks Id System

/dev/sdb 83 Linux

/dev/sdb 83 Linux

/dev/sdb 83 Linux

/dev/sdb 5 Extended

/dev/sdb 83 Linux

/dev/sdb 83 Linux

#上面的列表,就是我们今天分区的成果啦!接下来保存退出,重启计算机,就可以进行下一步的mkfs操作啦!如果忘记了相关的操作命令,记得按m!!!

Command (m for help): w #保存

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

另:在建好分区后,我们还可以更改相关分区的文件系统类型

#如,我们要把第二个主分区改成Linux下的交换分区,操作如下

Command (m for help): t #更改文件系统类型

Partition number (1-6): 2 #选择第二个分区

Hex code (type L to list codes): L #选择要更改的文件系统编码,可以按L来查看相关编码信息。

0 Empty NEC DOinix / old Lin bf Solaris

1 FAT9 Plan Linux swap / So c1 DRDOS/sec (FAT-

2 XENIX rootc PartitionMagic 83 Linuxc4 DRDOS/sec (FAT-

3 XENIX usrVenix OS/2 hidden C: c6 DRDOS/sec (FAT-

…………

16 Hidden FATNovell Netware af HFS / HFS+ fb VMware VMFS

17 Hidden HPFS/NTF 65 Novell Netware b7 BSDI fsfc VMware VMKCORE

18 AST SmartSleep 70 DiskSecure Mult b8 BSDI swapfd Linux raid auto

1b Hidden W95 FAT3 75 PC/IXbb Boot Wizard hid fe LANstep

1c Hidden W95 FAT3 80 Old Minixbe Solaris boot ff B

1e Hidden W95 FAT1

Hex code (type L to list codes):#查找到linux swap的编码为82

Changed system type of partition 2 to 82 (Linux swap / Solaris)

Command (m for help): p

…………..

Device Boot StartEnd Blocks Id System

/dev/sdb 83 Linux

/dev/sdb 82 Linux swap / Solaris

/dev/sdb 83 Linux

/dev/sdb 5 Extended

/dev/sdb 83 Linux

/dev/sdb 83 Linux

#最后别忘了保存!如果你须要的话!

#扩展分区不能直接使用,逻辑分区只能建立在扩展分区上!

第二步:mkfs(mkfs时分区的格式更好与fdisk设定的分区格式一致,不然…….)

mkfs支持ext2 ext3 vfa msdos jfs reiserfs等文件系统。

用法1:mkfs -t

例: mkfs -t ext3 /dev/sdb2

用法2:mkfs.

例:mkfs,vfat /dev/sdb3

mke2fs支持ext2/ext3文件系统

用法:mke2fs

例:mke2fs -j /dev/sdb5

# 更多更具体的用法请参照相关命令的man手册

下面,接着实验:

例一

# mkfs -t ext3 /dev/sdb1

mke2fs 1.41.12 (17-May-2023)

Filesystem label=

OS type: Linux

Block size=1024 (log=0)

Fragment size=1024 (log=0)

Stride=0 blocks, Stripe width=0 blocks

12824 inodes,blocks

2560 blocks (5.00%) reserved for the super user

First data block=1

Maximum filesystem blocks=

7 block groups

8192 blocks per group, 8192 fragments per group

1832 inodes per group

Superblock backups stored on blocks:

8193, 24577,

Writing inode tables: done

Creating journal (4096 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

第三部:挂载

挂载:mount

例:mount /dev/sdb1 /mnt /sdb1

卸载:umonut

例:umount /dev/sdb1

toggle se linux的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于toggle se linux,如何在 Linux 中使用 Toggle SE Linux 进行更好的系统保护?,Linux磁盘管理,在LINUX系统中,分区与格式化硬盘的命令是什么?的信息别忘了在本站进行查找喔。


数据运维技术 » 如何在 Linux 中使用 Toggle SE Linux 进行更好的系统保护? (toggle se linux)