内容全为个人理解和自查资料梳理,欢迎各位大神指点!

每天学习较为零散。

day21

一、磁盘维护流程

新硬盘(虚拟机可添加)

新硬盘需要做lvm管理

数据库迁移(夜间网站停机维护):

停止数据库监控

停止前端(关闭前端数据入口)关闭端口

systemctl stop apache2

停止后端(可选)。

停止mysql数据库(防止数据还在写入、或者锁表)

备份数据库(全备)

迁移数据到新硬盘(rsync)新硬盘已经做好了Ivm,且挂载

cp /usr/local/mysql

启动数据库

启动前端入口

测试数据速写

博客功能重新恢复上线

打开数据库监控
 

二、磁盘和硬盘

磁盘

​类型​​全称​​主要特点​​适用场景​
​IDE​Integrated Drive Electronics老旧并行接口,速度慢(≤133 MB/s)
不支持热插拔,兼容性极强
虚拟化中模拟传统硬件
兼容旧系统(如DOS/Windows 98)
​SCSI​Small Computer System Interface中高速接口(SAS可达12 Gbps)
支持多设备队列和热插拔
虚拟化中性能稳定(推荐选项)
企业级服务器/数据库存储
​SATA​Serial ATA主流机械硬盘接口(6 Gbps)
性价比高,容量大
延迟高于NVMe
家用PC/冷数据存储
​NVMe​Non-Volatile Memory ExpressPCIe通道直连,超低延迟(3.0 x4可达4 GB/s)
支持高并发IOPS(数万级)
需硬件支持
高性能需求(AI/高频交易/虚拟机宿主盘)

硬盘

特性​​机械硬盘(HDD)​​固态硬盘(SSD)​
​存储原理​磁性盘片 + 机械磁头读写NAND 闪存芯片(无机械部件)
​速度(典型值)​80-160 MB/s(SATA HDD)500-3500 MB/s(SATA/NVMe SSD)
​随机读写(IOPS)​50-200 IOPS(7200 RPM)50,000-500,000+ IOPS
​延迟​毫秒级(ms)微秒级(µs)
​抗震性​低(怕震动、跌落)高(无机械部件)
​噪音​有(磁头寻道声)无(静音)
​功耗​较高(5-7W)较低(2-5W)
​寿命​理论无限(磁头磨损)有限(P/E 擦写次数)
​容量​大(1TB-20TB+)较小(128GB-8TB)
​价格($/GB)​低(约 $0.02/GB)较高(约 0.08−0.2/GB)
​接口​SATA, SASSATA, NVMe (PCIe), U.2
​适用场景​大容量存储、冷数据备份系统盘、数据库、游戏、高性能计算

三、Linux 磁盘命名规则 

Linux 磁盘设备命名遵循 /dev/[前缀][字母][数字] 的格式

  • /dev/:设备文件目录
  • [前缀]:表示设备类型
  • [字母]:表示设备序号
  • [数字]:表示分区号(如有)

物理磁盘命名规则​

​接口类型​​命名格式​​示例​​说明​
​SATA/SCSI/SAS​/dev/sdX/dev/sdasd表示标准块设备,X为字母(a-z),按内核检测顺序分配
​NVMe​/dev/nvmeXnY/dev/nvme0n1X为控制器编号(从0开始),Y为命名空间编号(通常为1)
​IDE(已淘汰)​/dev/hdX/dev/hda现代Linux系统已统一改为sdX命名
​USB/移动设备​/dev/sdX/dev/sdc与SATA规则相同,按插入顺序分配字母

虚拟化环境磁盘命名​

​虚拟化类型​​命名格式​​示例​​说明​
​KVM/QEMU​/dev/vdX/dev/vdavd表示虚拟磁盘,常见于虚拟机环境
​云服务器(AWS等)​/dev/xvdX 或 /dev/nvmeXnY/dev/xvda云厂商可能自定义命名(如AWS使用xvda,部分云NVMe仍用标准命名)
 NVMe特殊命名

NVMe设备采用更复杂的命名:

  • /dev/nvme[控制器号]n[命名空间号]p[分区号]
  • 示例:
    • /dev/nvme0n1:第一个控制器的第一个命名空间
    • /dev/nvme0n1p1:上述设备的第一个分区

四、虚拟机ubuntu系统新磁盘分区

(一)、查看当前分区

root@xun-virtual-machine:~# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0    7:0    0  74.3M  1 loop /snap/core22/1612
loop1    7:1    0     4K  1 loop /snap/bare/5
loop2    7:2    0 271.2M  1 loop /snap/firefox/4848
loop3    7:3    0 505.1M  1 loop /snap/gnome-42-2204/176
loop4    7:4    0  91.7M  1 loop /snap/gtk-common-themes/1535
loop5    7:5    0  12.9M  1 loop /snap/snap-store/1113
loop6    7:6    0  38.8M  1 loop /snap/snapd/21759
loop7    7:7    0   500K  1 loop /snap/snapd-desktop-integration/178
sda      8:0    0    20G  0 disk 
├─sda1   8:1    0     1M  0 part 
├─sda2   8:2    0   513M  0 part /boot/efi
└─sda3   8:3    0  19.5G  0 part /
sdb      8:16   0    20G  0 disk 
sr0     11:0    1   4.4G  0 rom  /media/xun/Ubuntu 22.04.5 LTS amd64root@xun-virtual-machine:~# ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda3  /dev/sdb#分区类型: gpt  
root@xun-virtual-machine:~# fdisk -l
磁盘名              容量大小              扇区数量
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 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: gpt
Disk identifier: DA4CF18B-4933-4267-98FC-3BA281C856A6Device       Start      End  Sectors  Size Type
/dev/sda1     2048     4095     2048    1M BIOS boot
/dev/sda2     4096  1054719  1050624  513M EFI System
/dev/sda3  1054720 41940991 40886272 19.5G Linux filesystemDisk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 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

sda      8:0    0    20G  0 disk 
├─sda1   8:1    0     1M  0 part 
├─sda2   8:2    0   513M  0 part /boot/efi
└─sda3   8:3    0  19.5G  0 part /
sdb      8:16   0    20G  0 disk 

(二)、分区

小于2TB用fdisk  大于2TB用gdisk  

1、DOS (MBR) 相关命令​

  • a​:切换分区的“可启动”标志(用于设置引导分区)。
  • b​:编辑嵌套的 BSD 磁盘标签(高级功能)。
  • c​:切换 DOS 兼容性标志(影响旧系统兼容性)。

​2、通用分区操作​

  • d​:删除分区。
  • F​:列出未分区的空闲空间。
  • l​:显示已知的分区类型列表(如 Linux swap、NTFS 等)。
  • n​:创建新分区(需指定主分区/扩展分区)。
  • p​:打印当前分区表(查看分区信息)。
  • t​:更改分区类型(如将分区设为 Linux 文件系统或 swap)。
  • v​:验证分区表(检查错误)。
  • i​:显示某个分区的详细信息。

​3、其他功能​

  • m​:显示帮助菜单(即当前列表)。
  • u​:切换显示单位(如扇区/柱面)。
  • x​:进入专家模式(高级操作,谨慎使用)。

​4、脚本与磁盘标签​

  • I​:从脚本文件加载分区布局。
  • O​:将当前分区布局导出为脚本文件。

​5、保存与退出​

  • w​:保存分区表并退出(​​生效修改​​)。
  • q​:不保存修改,直接退出。

​6、创建新分区表​

  • g​:创建空的 ​​GPT 分区表​​(适用于大容量磁盘或 UEFI)。
  • G​:创建空的 SGI (IRIX) 分区表(特殊用途)。
  • o​:创建空的 ​​DOS (MBR) 分区表​​(传统 BIOS 兼容)。
  • s​:创建空的 Sun 分区表(Solaris 系统使用)。

(三)、主分区和扩展分区

MBR分区类型可有四个主分区、扩展分区,从编号5开始是逻辑分区

GPT分区类型可有128个主分区

 主分区(Primary Partition)​

  • ​定义​​:直接存储数据的独立分区,可安装操作系统(如 Windows、Linux)。
  • ​特点​​:
    • 一个硬盘最多只能有 ​​4 个主分区​​(MBR 限制)。
    • 可以直接格式化并挂载使用(如 /dev/sda1/dev/sda2)。
    • 主分区可以直接用于 ​​启动操作系统​​(如 /boot 分区)。
  • ​适用场景​​:
    • 安装操作系统(如 / 根分区、/boot 引导分区)。
    • 存储重要数据(如单独的数据盘)。

扩展分区(Extended Partition)​

  • ​定义​​:一种特殊的分区,本身不能直接存储数据,而是用来 ​​容纳逻辑分区(Logical Partition)​​。
  • ​特点​​:
    • 一个硬盘 ​​最多只能有 1 个扩展分区​​(MBR 限制)。
    • 扩展分区 ​​不能直接使用​​,必须在其内部创建 ​​逻辑分区​​ 才能存储数据。
    • 逻辑分区的编号从 5 开始(如 /dev/sda5/dev/sda6)。
    • ​突破 4 个分区的限制​​:通过扩展分区 + 逻辑分区,可以创建 ​​超过 4 个分区​​。
  • ​适用场景​​:
    • 当需要 ​​超过 4 个分区​​ 时(如多个数据盘)。
    • 不需要直接启动系统,仅用于存储数据。

(四)、分区过程

分区

root@xun-virtual-machine:~# fdisk /dev/sdb Welcome to fdisk (util-linux 2.37.2).
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 0xf4811a33.Command (m for help): mHelp:DOS (MBR)a   toggle a bootable flagb   edit nested BSD disklabelc   toggle the dos compatibility flagGenericd   delete a partitionF   list free unpartitioned spacel   list known partition typesn   add a new partitionp   print the partition tablet   change a partition typev   verify the partition tablei   print information about a partitionMiscm   print this menuu   change display/entry unitsx   extra functionality (experts only)ScriptI   load disk layout from sfdisk script fileO   dump disk layout to sfdisk script fileSave & Exitw   write table to disk and exitq   quit without saving changesCreate a new labelg   create a new empty GPT partition tableG   create a new empty SGI (IRIX) partition tableo   create a new empty DOS partition tables   create a new empty Sun partition tableCommand (m for help): 

    
    #打印当前分区
    Command (m for help): p
    Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 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: 0xf4811a33#创建新分区
    Command (m for help): n
    Partition typep   primary (0 primary, 0 extended, 4 free)e   extended (container for logical partitions)#创建主分区
    Select (default p): p#回车默认从1开始
    Partition number (1-4, default 1): #回车默认从当前扇区开始
    First sector (2048-41943039, default 2048): # +2G 给主分区2G内存
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-41943039, default 41943039): +2GCreated a new partition 1 of type 'Linux' and of size 2 GiB.#打印当前分区
    Command (m for help): p
    Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 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: 0xf4811a33Device     Boot Start     End Sectors Size Id Type
    /dev/sdb1        2048 4196351 4194304   2G 83 Linux#创建新分区
    Command (m for help): n
    Partition typep   primary (1 primary, 0 extended, 3 free)e   extended (container for logical partitions)#创建扩建分区
    Select (default p): e#回车默认2
    Partition number (2-4, default 2): #回车默认从当前扇区开始
    First sector (4196352-41943039, default 4196352): #回车默认将剩余内容全部给扩建分区
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (4196352-41943039, default 41943039): Created a new partition 2 of type 'Extended' and of size 18 GiB.#打印当前分区
    Command (m for help): p
    Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 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: 0xf4811a33Device     Boot   Start      End  Sectors Size Id Type
    /dev/sdb1          2048  4196351  4194304   2G 83 Linux
    /dev/sdb2       4196352 41943039 37746688  18G  5 Extended#新建分区(主分区和扩展分区名额已用完(MBR 限制),只能在扩展分区内创建逻辑分区)
    Command (m for help): n
    All space for primary partitions is in use.
    Adding logical partition 5#回车从当前连续扇区开始
    First sector (4198400-41943039, default 4198400): #给第一个逻辑分区分10G内存
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (4198400-41943039, default 41943039): +10GCreated a new partition 5 of type 'Linux' and of size 10 GiB.#打印
    Command (m for help): p
    Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 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: 0xf4811a33Device     Boot   Start      End  Sectors Size Id Type
    /dev/sdb1          2048  4196351  4194304   2G 83 Linux
    /dev/sdb2       4196352 41943039 37746688  18G  5 Extended
    /dev/sdb5       4198400 25169919 20971520  10G 83 Linux#新建分区
    Command (m for help): n
    All space for primary partitions is in use.
    Adding logical partition 6
    First sector (25171968-41943039, default 25171968): #回车将剩余内存全部给第二个逻辑分区
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (25171968-41943039, default 41943039): Created a new partition 6 of type 'Linux' and of size 8 GiB.Command (m for help): p
    Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 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: 0xf4811a33Device     Boot    Start      End  Sectors Size Id Type
    /dev/sdb1           2048  4196351  4194304   2G 83 Linux
    /dev/sdb2        4196352 41943039 37746688  18G  5 Extended
    /dev/sdb5        4198400 25169919 20971520  10G 83 Linux
    /dev/sdb6       25171968 41943039 16771072   8G 83 Linux#保存分区并退出
    Command (m for help): w
    The partition table has been altered.
    Calling ioctl() to re-read partition table.
    Syncing disks.
    #查看分区信息
    root@xun-virtual-machine:~# lsblk
    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
    loop0    7:0    0  74.3M  1 loop /snap/core22/1612
    loop1    7:1    0     4K  1 loop /snap/bare/5
    loop2    7:2    0 271.2M  1 loop /snap/firefox/4848
    loop3    7:3    0 505.1M  1 loop /snap/gnome-42-2204/176
    loop4    7:4    0  91.7M  1 loop /snap/gtk-common-themes/1535
    loop5    7:5    0  12.9M  1 loop /snap/snap-store/1113
    loop6    7:6    0  38.8M  1 loop /snap/snapd/21759
    loop7    7:7    0   500K  1 loop /snap/snapd-desktop-integration/178
    sda      8:0    0    20G  0 disk 
    ├─sda1   8:1    0     1M  0 part 
    ├─sda2   8:2    0   513M  0 part /boot/efi
    └─sda3   8:3    0  19.5G  0 part /
    sdb      8:16   0    20G  0 disk 
    ├─sdb1   8:17   0     2G  0 part 
    ├─sdb2   8:18   0     1K  0 part 
    ├─sdb5   8:21   0    10G  0 part 
    └─sdb6   8:22   0     8G  0 part 
    sr0     11:0    1   4.4G  0 rom  /media/xun/Ubuntu 22.04.5 LTS amd64#更新分区信息
    root@xun-virtual-machine:~# partx  /dev/sdb
    NR    START      END  SECTORS SIZE NAME UUID1     2048  4196351  4194304   2G      f4811a33-012  4196352 41943039 37746688  18G      f4811a33-025  4198400 25169919 20971520  10G      f4811a33-056 25171968 41943039 16771072   8G      f4811a33-06#分区类型是dos
    root@xun-virtual-machine:~# fdisk -l /dev/sdb
    Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 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: 0xf4811a33Device     Boot    Start      End  Sectors Size Id Type
    /dev/sdb1           2048  4196351  4194304   2G 83 Linux
    /dev/sdb2        4196352 41943039 37746688  18G  5 Extended
    /dev/sdb5        4198400 25169919 20971520  10G 83 Linux
    /dev/sdb6       25171968 41943039 16771072   8G 83 Linux

    parted指令修改磁盘分区表类型

    (通常用gdisk修改磁盘表类型)

    mklabel gpt ​会清空分区,​需用户手动备份,且仅创建 GPT 标签

    先删除原dos类型磁盘里的分区

    root@xun-virtual-machine:~# fdisk /dev/sdbDevice     Boot    Start      End  Sectors Size Id Type
    /dev/sdb1           2048  4196351  4194304   2G 83 Linux
    /dev/sdb2        4196352 41943039 37746688  18G  5 Extended
    /dev/sdb5        4198400 25169919 20971520  10G 83 Linux
    /dev/sdb6       25171968 41943039 16771072   8G 83 Linux
    root@xun-virtual-machine:~# fdisk /dev/sdbWelcome to fdisk (util-linux 2.37.2).
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.Command (m for help): mHelp:DOS (MBR)a   toggle a bootable flagb   edit nested BSD disklabelc   toggle the dos compatibility flagGenericd   delete a partitionF   list free unpartitioned spacel   list known partition typesn   add a new partitionp   print the partition tablet   change a partition typev   verify the partition tablei   print information about a partitionMiscm   print this menuu   change display/entry unitsx   extra functionality (experts only)ScriptI   load disk layout from sfdisk script fileO   dump disk layout to sfdisk script fileSave & Exitw   write table to disk and exitq   quit without saving changesCreate a new labelg   create a new empty GPT partition tableG   create a new empty SGI (IRIX) partition tableo   create a new empty DOS partition tables   create a new empty Sun partition table#分别删除6、5、2、1分区
    Command (m for help): d
    Partition number (1,2,5,6, default 6): Partition 6 has been deleted.Command (m for help): d
    Partition number (1,2,5, default 5): Partition 5 has been deleted.Command (m for help): d
    Partition number (1,2, default 2): Partition 2 has been deleted.Command (m for help): d
    Selected partition 1
    Partition 1 has been deleted.Command (m for help): p
    Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 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: 0xf4811a33Command (m for help): w
    The partition table has been altered.
    Calling ioctl() to re-read partition table.
    Syncing disks.root@xun-virtual-machine:~# lsblk
    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
    loop0    7:0    0  74.3M  1 loop /snap/core22/1612
    loop1    7:1    0     4K  1 loop /snap/bare/5
    loop2    7:2    0 271.2M  1 loop /snap/firefox/4848
    loop3    7:3    0 505.1M  1 loop /snap/gnome-42-2204/176
    loop4    7:4    0  91.7M  1 loop /snap/gtk-common-themes/1535
    loop5    7:5    0  12.9M  1 loop /snap/snap-store/1113
    loop6    7:6    0  38.8M  1 loop /snap/snapd/21759
    loop7    7:7    0   500K  1 loop /snap/snapd-desktop-integration/178
    sda      8:0    0    20G  0 disk 
    ├─sda1   8:1    0     1M  0 part 
    ├─sda2   8:2    0   513M  0 part /boot/efi
    └─sda3   8:3    0  19.5G  0 part /
    sdb      8:16   0    20G  0 disk 
    sr0     11:0    1   4.4G  0 rom  /media/xun/Ubuntu 22.04.5 LTS amd64

    用parted命令将磁盘类型修改为gpt

    root@xun-virtual-machine:~# parted /dev/sdb
    GNU Parted 3.4
    Using /dev/sdb
    Welcome to GNU Parted! Type 'help' to view a list of commands.#打印分区表信息和类型
    (parted) print                                                            
    Model: VMware, VMware Virtual S (scsi)
    Disk /dev/sdb: 21.5GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Disk Flags: Number  Start  End  Size  Type  File system  Flags#修改
    (parted) mklabel gpt                                                      
    Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you
    want to continue?
    Yes/No? y                                                                 #打印分区表信息和类型
    (parted) print                                                      
    Model: VMware, VMware Virtual S (scsi)
    Disk /dev/sdb: 21.5GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    Disk Flags: Number  Start  End  Size  File system  Name  Flags(parted)           

    用gdisk指令修改磁盘分区

    gdisk命令将dos类型转为gpt类型会保留分区数据,精细操作、无损转换

    root@xun-virtual-machine:~# gdisk -l /dev/sdb
    GPT fdisk (gdisk) version 1.0.8Partition table scan:MBR: protectiveBSD: not presentAPM: not presentGPT: presentFound valid GPT with protective MBR; using GPT.
    Disk /dev/sdb: 41943040 sectors, 20.0 GiB
    Model: VMware Virtual S
    Sector size (logical/physical): 512/512 bytes
    Disk identifier (GUID): 03BE9DAE-41A2-4DCB-9E45-6B8F352D6BAA
    Partition table holds up to 128 entries
    Main partition table begins at sector 2 and ends at sector 33
    First usable sector is 34, last usable sector is 41943006
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 41942973 sectors (20.0 GiB)Number  Start (sector)    End (sector)  Size       Code  Name#用gdisk命令给gpt类型磁盘分区
    root@xun-virtual-machine:~# gdisk  /dev/sdb
    GPT fdisk (gdisk) version 1.0.8Partition table scan:MBR: protectiveBSD: not presentAPM: not presentGPT: presentFound valid GPT with protective MBR; using GPT.Command (? for help): ?
    b	back up GPT data to a file
    c	change a partition's name
    d	delete a partition
    i	show detailed information on a partition
    l	list known partition types
    n	add a new partition
    o	create a new empty GUID partition table (GPT)
    p	print the partition table
    q	quit without saving changes
    r	recovery and transformation options (experts only)
    s	sort partitions
    t	change a partition's type code
    v	verify disk
    w	write table to disk and exit
    x	extra functionality (experts only)
    ?	print this menu#添加新分区
    Command (? for help): n#回车 默认
    Partition number (1-128, default 1): #回车 默认
    First sector (34-41943006, default = 2048) or {+-}size{KMGTP}: #分2GB
    Last sector (2048-41943006, default = 41943006) or {+-}size{KMGTP}: +2GCurrent type is 8300 (Linux filesystem)#回车 默认
    Hex code or GUID (L to show codes, Enter = 8300): 
    Changed type of partition to 'Linux filesystem'#打印分区信息
    Command (? for help): p
    Disk /dev/sdb: 41943040 sectors, 20.0 GiB
    Model: VMware Virtual S
    Sector size (logical/physical): 512/512 bytes
    Disk identifier (GUID): 03BE9DAE-41A2-4DCB-9E45-6B8F352D6BAA
    Partition table holds up to 128 entries
    Main partition table begins at sector 2 and ends at sector 33
    First usable sector is 34, last usable sector is 41943006
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 37748669 sectors (18.0 GiB)Number  Start (sector)    End (sector)  Size       Code  Name1            2048         4196351   2.0 GiB     8300  Linux filesystem#添加新分区
    Command (? for help): n#回车 默认
    Partition number (2-128, default 2): #回车 默认
    First sector (34-41943006, default = 4196352) or {+-}size{KMGTP}: #分5GB
    Last sector (4196352-41943006, default = 41943006) or {+-}size{KMGTP}: +5G#回车 默认
    Current type is 8300 (Linux filesystem)
    Hex code or GUID (L to show codes, Enter = 8300): 
    Changed type of partition to 'Linux filesystem'#打印分区信息
    Command (? for help): p
    Disk /dev/sdb: 41943040 sectors, 20.0 GiB
    Model: VMware Virtual S
    Sector size (logical/physical): 512/512 bytes
    Disk identifier (GUID): 03BE9DAE-41A2-4DCB-9E45-6B8F352D6BAA
    Partition table holds up to 128 entries
    Main partition table begins at sector 2 and ends at sector 33
    First usable sector is 34, last usable sector is 41943006
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 27262909 sectors (13.0 GiB)Number  Start (sector)    End (sector)  Size       Code  Name1            2048         4196351   2.0 GiB     8300  Linux filesystem2         4196352        14682111   5.0 GiB     8300  Linux filesystem#将剩余内存给第三个分区
    Command (? for help): n
    Partition number (3-128, default 3): 
    First sector (34-41943006, default = 14682112) or {+-}size{KMGTP}: 
    Last sector (14682112-41943006, default = 41943006) or {+-}size{KMGTP}: 
    Current type is 8300 (Linux filesystem)
    Hex code or GUID (L to show codes, Enter = 8300): 
    Changed type of partition to 'Linux filesystem'#打印分区信息
    Command (? for help): p
    Disk /dev/sdb: 41943040 sectors, 20.0 GiB
    Model: VMware Virtual S
    Sector size (logical/physical): 512/512 bytes
    Disk identifier (GUID): 03BE9DAE-41A2-4DCB-9E45-6B8F352D6BAA
    Partition table holds up to 128 entries
    Main partition table begins at sector 2 and ends at sector 33
    First usable sector is 34, last usable sector is 41943006
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 2014 sectors (1007.0 KiB)Number  Start (sector)    End (sector)  Size       Code  Name1            2048         4196351   2.0 GiB     8300  Linux filesystem2         4196352        14682111   5.0 GiB     8300  Linux filesystem3        14682112        41943006   13.0 GiB    8300  Linux filesystem#保存退出
    Command (? for help): wFinal checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
    PARTITIONS!!Do you want to proceed? (Y/N): y
    OK; writing new GUID partition table (GPT) to /dev/sdb.
    The operation has completed successfully.
    
    root@xun-virtual-machine:~# lsblk
    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
    loop0    7:0    0  74.3M  1 loop /snap/core22/1612
    loop1    7:1    0     4K  1 loop /snap/bare/5
    loop2    7:2    0 271.2M  1 loop /snap/firefox/4848
    loop3    7:3    0 505.1M  1 loop /snap/gnome-42-2204/176
    loop4    7:4    0  91.7M  1 loop /snap/gtk-common-themes/1535
    loop5    7:5    0  12.9M  1 loop /snap/snap-store/1113
    loop6    7:6    0  38.8M  1 loop /snap/snapd/21759
    loop7    7:7    0   500K  1 loop /snap/snapd-desktop-integration/178
    sda      8:0    0    20G  0 disk 
    ├─sda1   8:1    0     1M  0 part 
    ├─sda2   8:2    0   513M  0 part /boot/efi
    └─sda3   8:3    0  19.5G  0 part /
    sdb      8:16   0    20G  0 disk 
    ├─sdb1   8:17   0     2G  0 part 
    ├─sdb2   8:18   0     5G  0 part 
    └─sdb3   8:19   0    13G  0 part 
    sr0     11:0    1   4.4G  0 rom  /media/xun/Ubuntu 22.04.5 LTS amd64
    root@xun-virtual-machine:~# 
    

    用gdisk命令将gpt改为dos

    root@xun-virtual-machine:~# gdisk  /dev/sdb
    GPT fdisk (gdisk) version 1.0.8Partition table scan:MBR: protectiveBSD: not presentAPM: not presentGPT: presentFound valid GPT with protective MBR; using GPT.# 进入恢复/转换模式
    Command (? for help): r# 将 GPT 转换为 MBR
    Recovery/transformation command (? for help): g#保存退出
    MBR command (? for help): wConverted 3 partitions. Finalize and exit? (Y/N): y
    GPT data structures destroyed! You may now partition the disk using fdisk or
    other utilities.root@xun-virtual-machine:~# fdisk -l /dev/sdb
    Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 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: 0x00000000Device     Boot    Start      End  Sectors Size Id Type
    /dev/sdb1           2048  4196351  4194304   2G 83 Linux
    /dev/sdb2        4196352 14682111 10485760   5G 83 Linux
    /dev/sdb3       14682112 41943006 27260895  13G 83 Linux
    

    五、主流文件系统

    1、Linux 主流文件系统​

    文件系统特点适用场景
    ​ext4​默认文件系统,稳定高效,支持日志、大文件(16TB)、快照(实验性)通用 Linux 系统
    ​XFS​高性能(尤其大文件并发读写),支持在线扩容、崩溃恢复快服务器、数据库、大文件存储
    ​Btrfs​支持写时复制(CoW)、快照、压缩、RAID 集成,但稳定性待优化实验性需求(如快照备份)
    ​ZFS​高级功能(数据校验、压缩、RAID-Z),但内存占用高,需额外安装NAS/企业存储(非默认内核支持)

    ​2、Windows 主流文件系统​

    文件系统特点适用场景
    ​NTFS​支持 ACL 权限、加密、压缩、日志,兼容大文件(16EB)现代 Windows 系统盘/数据盘
    ​FAT32​兼容性强(UEFI/旧设备),但单文件 ≤4GB,无权限控制U 盘、SD 卡、跨平台传输
    ​exFAT​改进版 FAT32,支持大文件(16EB),无日志,适合闪存大容量移动设备(如 SSD 移动硬盘)

    ​3、macOS 主流文件系统​

    文件系统特点适用场景
    ​APFS​优化 SSD 性能,支持快照、加密、空间共享(多个卷共用存储池)macOS 10.13+ 系统盘
    ​HFS+​旧版文件系统,兼容老设备,逐渐被淘汰旧版 macOS(10.12 及更早)

    ​4、跨平台/专用文件系统​

    文件系统特点适用场景
    ​FAT32​几乎全平台兼容(Win/Linux/macOS/游戏机),但功能受限U 盘、相机 SD 卡
    ​exFAT​跨平台 + 大文件支持,无日志大容量移动设备(如外接硬盘)
    ​NFS​网络文件系统,支持远程挂载Linux/Unix 服务器共享
    ​SMB/CIFS​Windows 网络共享协议,跨平台访问Windows/Linux/macOS 文件共享

    六、mkfs格式化文件系统

    #格式化之前,将/dev/sdb分区重新分为一个分区
    #输入mkfs按Tab 查看可格式化的文件类型
    root@xun-virtual-machine:~# mkfsmkfs.bfs     mkfs.ext2    mkfs.ext4    mkfs.minix   mkfs.ntfs    mkfs         mkfs.cramfs  mkfs.ext3    mkfs.fat     mkfs.msdos   mkfs.vfat  #下载xfs文件类型
    root@xun-virtual-machine:~# apt install xfsprogsroot@xun-virtual-machine:~# mkfs.xfs /dev/sdb1 
    meta-data=/dev/sdb1              isize=512    agcount=4, agsize=1310656 blks=                       sectsz=512   attr=2, projid32bit=1=                       crc=1        finobt=1, sparse=1, rmapbt=0=                       reflink=1    bigtime=0 inobtcount=0
    data     =                       bsize=4096   blocks=5242624, imaxpct=25=                       sunit=0      swidth=0 blks
    naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
    log      =internal log           bsize=4096   blocks=2560, version=2=                       sectsz=512   sunit=0 blks, lazy-count=1
    realtime =none                   extsz=4096   blocks=0, rtextents=0
    root@xun-virtual-machine:~# lsblk -f
    NAME   FSTYPE  FSVER         LABEL                    UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
    loop0  squashf 4.0                                                                               0   100% /snap/core22/1612
    loop1  squashf 4.0                                                                               0   100% /snap/bare/5
    loop2  squashf 4.0                                                                               0   100% /snap/firefox/4848
    loop3  squashf 4.0                                                                               0   100% /snap/gnome-42-2204/176
    loop4  squashf 4.0                                                                               0   100% /snap/gtk-common-themes/1535
    loop5  squashf 4.0                                                                               0   100% /snap/snap-store/1113
    loop6  squashf 4.0                                                                               0   100% /snap/snapd/21759
    loop7  squashf 4.0                                                                               0   100% /snap/snapd-desktop-integration/178
    sda                                                                                                       
    ├─sda1                                                                                                    
    ├─sda2 vfat    FAT32                                  93B7-EECE                             505.9M     1% /boot/efi
    └─sda3 ext4    1.0                                    c1b5a816-3361-4198-824d-9eccd35fb055    6.1G    63% /
    sdb                                                                                                       
    └─sdb1 xfs                                            ec06f339-9c80-49fa-8c4d-14726b8d274a                
    sr0    iso9660 Joliet Extens Ubuntu 22.04.5 LTS amd64 2024-09-11-14-37-52-00                     0   100% /media/xun/Ubuntu 22.04.5 LTS amd64
    

    查看xfs文件系统信息 

    root@xun-virtual-machine:~# xfs_info /dev/sdb1
    meta-data=/dev/sdb1              isize=512    agcount=4, agsize=1310656 blks=                       sectsz=512   attr=2, projid32bit=1=                       crc=1        finobt=1, sparse=1, rmapbt=0=                       reflink=1    bigtime=0 inobtcount=0
    data     =                       bsize=4096   blocks=5242624, imaxpct=25=                       sunit=0      swidth=0 blks
    naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
    log      =internal log           bsize=4096   blocks=2560, version=2=                       sectsz=512   sunit=0 blks, lazy-count=1
    realtime =none                   extsz=4096   blocks=0, rtextents=0
    
    参数​​值/状态​​说明​
    ​isize​512inode 大小(字节),默认 512 字节足够。
    ​agcount​4Allocation Group(分配组)数量,影响并行性能。
    ​agsize​1310656 blks每个分配组的块数(块大小 bsize=4096,即 4KiB)。
    ​crc​1 (enabled)启用元数据校验和,提高数据完整性。
    ​finobt​1 (enabled)启用空闲 inode B+树,加速文件创建。
    ​reflink​1 (enabled)支持写时复制(CoW),适合快照和备份。
    ​log​internal日志(journal)内置于文件系统中,无需额外分区。
    ​bsize​4096数据块大小(4KiB),与大多数 SSD 的物理块大小对齐。
    ​sectsz​512磁盘扇区大小(通常为 512B 或 4K)。

    七、mount指令临时和永久挂载

    磁盘分区有文件系统才能挂载目录,之后就能用该分区存储数据了

    #临时挂载 
    # mount命令 磁盘分区   需要挂载到的目录 
    root@xun-virtual-machine:~# mount /dev/sdb1  /a1/my_sdb1/
    #永久挂载
    #编辑 添加
    /dev/sdb1:设备路径
    /a1/my_sdb1:挂载点目录
    xfs:文件系统类型
    defaults:挂载选项(包括 rw,relatime 等)
    0 0:不备份(dump)和不检查(fsck)root@xun-virtual-machine:~# vim /etc/fstab /dev/sdb1  /a1/my_sdb1  xfs defaults 0 0#验证当前挂载状态​
    root@xun-virtual-machine:/a1/my_sdb1# mount | grep /dev/sdb1
    /dev/sdb1 on /a1/my_sdb1 type xfs (rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota)#测试永久挂载​#卸载并重新挂载​
    root@xun-virtual-machine:/a1# umount /dev/sdb1#重新挂载所有 /etc/fstab 中的条目
    root@xun-virtual-machine:/a1# mount -a#验证挂载​
    root@xun-virtual-machine:/a1# ls /a1/my_sdb1/
    test.txt#检查挂载的文件系统类型和空间
    root@xun-virtual-machine:/a1# df -hT | grep /dev/sdb1
    /dev/sdb1      xfs       20G  175M   20G   1% /a1/my_sdb1
    

    取消挂载时的报错

    在挂载目录

    #此时退出当前目录即可取消挂载
    root@xun-virtual-machine:/a1/my_sdb1# umount /a1/my_sdb1/
    umount: /a1/my_sdb1/: target is busy.
    

    不在挂载目录 

    #有进程正在访问挂载点
    root@xun-virtual-machine:~# umount /a1/my_sdb1/
    umount: /a1/my_sdb1/: target is busy.
    

     用lsof指令查看目录下的进程

    root@xun-virtual-machine:~# lsof /a1/my_sdb1/COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
    bash    2486 root  cwd    DIR   8,17       22  128 /a1/my_sdb1
    root@xun-virtual-machine:~# 
    

     延迟卸载

    #如果无法立即终止进程,可尝试延迟卸载(内核会在空闲时自动卸载)
    umount -l /a1/my_sdb

    立即卸载 

    #强制结束占用进程
    sudo kill -9 <PID>  

    八、dd指令

    ​场景​​命令示例​
    磁盘备份dd if=/dev/sda of=/backup.img bs=4M status=progress
    磁盘克隆dd if=/dev/sdb of=/dev/sdc bs=4M status=progress
    创建空文件dd if=/dev/zero of=file.bin bs=1G count=1
    安全擦除dd if=/dev/urandom of=/dev/sdb bs=1M status=progress
    测试速度dd if=/dev/zero of=testfile bs=1G count=1 oflag=direct

     找到磁盘中占内存的大文件并删除

    #在a1目录下创建一个3G的空文件
    root@xun-virtual-machine:/a1# dd if=/dev/zero of=/a1/3Gfile.txt bs=1G count=3
    3+0 records in
    3+0 records out
    3221225472 bytes (3.2 GB, 3.0 GiB) copied, 11.0103 s, 293 MB/s#查看磁盘信息/dev/sda3        20G   15G  3.1G  83%  使用83%
    root@xun-virtual-machine:/a1# df -h
    Filesystem      Size  Used Avail Use% Mounted on
    tmpfs           387M  1.7M  386M   1% /run
    /dev/sda3        20G   15G  3.1G  83% /
    tmpfs           1.9G     0  1.9G   0% /dev/shm
    tmpfs           5.0M  4.0K  5.0M   1% /run/lock
    /dev/sdb1        20G  175M   20G   1% /a1/my_sdb1
    /dev/sda2       512M  6.1M  506M   2% /boot/efi
    tmpfs           387M   92K  387M   1% /run/user/1000
    /dev/sr0        4.5G  4.5G     0 100% /media/xun/Ubuntu 22.04.5 LTS amd64#筛选找到大于2g的文件
    root@xun-virtual-machine:/a1# find / -size +2G -type f
    /swapfile
    /a1/3Gfile.txt
    /media/xun/Ubuntu 22.04.5 LTS amd64/casper/filesystem.squashfs
    /proc/kcore#删除
    root@xun-virtual-machine:/a1# rm 3Gfile.txt #/dev/sda3        20G   12G  6.1G  67% 使用67%
    root@xun-virtual-machine:/a1# df -h
    Filesystem      Size  Used Avail Use% Mounted on
    tmpfs           387M  1.7M  386M   1% /run
    /dev/sda3        20G   12G  6.1G  67% /
    tmpfs           1.9G     0  1.9G   0% /dev/shm
    tmpfs           5.0M  4.0K  5.0M   1% /run/lock
    /dev/sdb1        20G  175M   20G   1% /a1/my_sdb1
    /dev/sda2       512M  6.1M  506M   2% /boot/efi
    tmpfs           387M   92K  387M   1% /run/user/1000
    /dev/sr0        4.5G  4.5G     0 100% /media/xun/Ubuntu 22.04.5 LTS amd64

    本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
    如若转载,请注明出处:http://www.pswp.cn/web/84610.shtml
    繁体地址,请注明出处:http://hk.pswp.cn/web/84610.shtml
    英文地址,请注明出处:http://en.pswp.cn/web/84610.shtml

    如若内容造成侵权/违法违规/事实不符,请联系英文站点网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

    相关文章

    腾讯云轻量级服务器Ubuntu系统与可视化界面

    以云服务器的方式搭建Linux workstation对比在电脑本地安装虚拟机的优势在于&#xff0c;不需要占用本地电脑资源空间&#xff0c;网络环境等相对稳定&#xff0c;可以用手机等轻量移动设备连接管理等。本文主要介绍使用腾讯云服务器&#xff0c;搭建Ubuntu Linux系统以及可视化…

    如何在MacOS系统和Windows系统安装节点小宝远程工具

    如何在MacOS系统和Windows系统安装节点小宝远程工具 摘要 本文讲述如何在MacOS系统和Windows系统安装节点小宝远程工具&#xff0c;并详细介绍了配置和使用远程控制的步骤。无论是在个人电脑还是手机、平板设备之间的远程连接&#xff0c;您都可以通过本教程轻松实现。 文章…

    60天python训练营打卡day38

    学习目标&#xff1a; 60天python训练营打卡 学习内容&#xff1a; DAY 38 Dataset和Dataloader类 知识点回顾&#xff1a; 1.Dataset类的__getitem__和__len__方法&#xff08;本质是python的特殊方法&#xff09; 2.Dataloader类 3.minist手写数据集的了解 作业&#xff1a…

    Python 邻接表详细实现指南

    邻接表是图数据结构的一种高效表示方法&#xff0c;特别适合表示稀疏图。下面我将用 Python 详细讲解邻接表的多种实现方式、操作方法和实际应用。 一、邻接表基础概念 邻接表的核心思想是为图中的每个顶点维护一个列表&#xff0c;存储与该顶点直接相连的所有邻接顶点。 邻…

    Nginx反向代理解决跨域问题详解

    Nginx反向代理解决跨域问题详解 核心原理 Nginx反向代理解决跨域的核心思路是让客户端请求同域名下的接口&#xff0c;由Nginx将请求转发到目标服务器&#xff0c;从而规避浏览器的同源策略限制。 客户端&#xff08;同源&#xff1a;www.domain.com&#xff09;↓Nginx&…

    单片机测ntc热敏电阻的几种方法

    在单片机中测量NTC&#xff08;负温度系数&#xff09;热敏电阻的阻值&#xff0c;通常需要将其转换为电压或频率信号&#xff0c;再通过单片机进行采集和处理。以下是几种常见的方法及其详细说明&#xff1a; 1. 分压法&#xff08;最常用&#xff09;​​ ​​原理​​&…

    一套基于粒子群优化(PSO)算法的天线波束扫描MATLAB实现方案

    以下是一套基于粒子群优化(PSO)算法的天线波束扫描MATLAB实现方案,包含完整代码、数学原理和详细注释。该方案针对均匀线性阵列(ULA)的波束方向图优化,通过调整阵元相位实现主瓣指向目标方向并抑制旁瓣。 %% 天线波束扫描的PSO算法实现 % 作者:DeepSeek % 创建日期:20…

    增量学习ASAP的源码剖析:如何实现人形的运动追踪和全身控制(核心涉及HumanoidVerse中的agents模块)

    前言 过去一周&#xff0c;我司「七月在线」长沙分部的具身团队在机械臂和人形上并行发力 关于机械臂 一方面&#xff0c;在IL和VLA的路线下&#xff0c;先后采集了抓杯子、桌面收纳、插入耳机孔的数据&#xff0c;然后云端训-本地5090推理 二方面&#xff0c;在RL的路线下&a…

    计算机网络学习笔记:应用层概述、动态主机配置协议DHCP

    文章目录 一、应用层概述1.1、C/S架构1.2、P2P架构 二、动态主机配置协议DHCP2.1、DHCP发现报文2.2、DHCP提供报文2.3、DHCP请求报文2.4、DHCP确认报文2.5、DHCP的续约与终止 总结 一、应用层概述 应用层位于计算机网络结构的最上层&#xff0c;用于解决应用进程的交互以实现特…

    为服务器SSH登录增加2FA验证

    安装NTP模块并设置时区 安装NTP模块 一般的服务器NTP服务默认是不安装的&#xff0c;需要安装NTP模块【7】并启用。 运行以下指令检查你的NTP模块是否已启用&#xff0c;已启用则忽略安装NTP模块的内容 timedatectl 如果你的返回内容和以下图片一样&#xff0c;则表示NTP未…

    AI大模型提示词工程研究报告:长度与效果的辩证分析

    一、核心问题&#xff1a;提示词长度与模型性能的平衡 核心矛盾&#xff1a;提示词长度增加 → 信息丰富度↑ & 准确性↑ ↔ 计算成本↑ & 响应延迟↑ 二、详细机制分析 &#xff08;一&#xff09;长提示词的优势&#xff08;实证数据支持&#xff09; 案例类型短提…

    HttpServletResponse源码解析

    Java Servlet API 中 HttpServletResponse 接口的源码&#xff0c;这是 Java Web 开发中非常核心的一个接口&#xff0c;用于向客户端&#xff08;通常是浏览器&#xff09;发送 HTTP 响应。 public interface HttpServletResponse extends ServletResponse {int SC_CONTINUE …

    AI基础概念

    目录 1、ASR和STT区别 2、流式输出 定义 原理 应用场景 优点 缺点 3、Ollama 4、mindspore和deepseek r1 v3 5、DeepSeek R1/V3 用的哪个底层AI框架 6、HAI-LLM比tensorflow、pytorch还强么 1. 核心优势对比 2. 性能表现 3. 适用场景 总结 7、openai用的什么底层…

    ubuntu20.04速腾聚创airy驱动调试

    1.下载相关资料 下载包括&#xff1a;速腾airy产品手册.pdf、RSView&#xff08;用于显示激光雷达数据&#xff09;、3d数模文件、 RS-LiDAR-16用户手册 以下链接进行下载 https://www.robosense.cn/resources 2.连接线路后通过Wireshark抓包后进行本地IP配置 2.1按照线路连…

    Redis的大key和热key如何解决

    文章目录 Redis大Key一、什么是Redis大Key二、大Key的产生原因三、大Key的影响四、大Key的解决方案1. 检测大Key2. 解决方案(1) 数据拆分(2) 使用压缩算法(3) 使用合适的数据结构(4) 设置合理的过期时间(5) 合理清理(6) 配置优化 五、预防措施总结 Redis热key一、热Key问题的本…

    恒温晶振与温补晶振的区别

    在电子设备领域&#xff0c;晶振如同精准的“心脏起搏器”&#xff0c;为电路提供稳定的时钟信号。恒温晶振&#xff08;OCXO&#xff09;和温补晶振&#xff08;TCXO&#xff09;作为两类重要的晶体振荡器&#xff0c;在不同的应用场景中发挥着关键作用&#xff0c;它们的区别…

    基于SpringBoot的在线考试智能监控系统设计与实现

    目录 一.&#x1f981;前言二.&#x1f981;开源代码与组件使用情况说明三.&#x1f981;核心功能1. ✅算法设计2. ✅Java开发语言3. ✅Vue.js框架4. ✅部署项目 四.&#x1f981;演示效果1. 管理员模块1.1 用户管理 2. 教师模块2.1 考试管理2.2 浏览试题列表2.3 添加试题2.4 成…

    0基础学Python系列【16】自动化邮件发送的终极教程:Python库smtplib与email详解

    大家好,欢迎来到Python学习的第二站!🎉 Python自带了一些超好用的模块,可以让你不必从头写代码就能实现很多功能。比如数学计算、文件操作、网络通信等。花姐会挑选常用的一些模块来讲解,确保你能在实际项目中用到。🎉 本章要学什么? 接下来花姐会深入浅出的讲解下面…

    环卫车辆定位与监管:安心联车辆监控管理平台--科技赋能城市环境卫生管理

    一、 引言 城市环境卫生是城市文明的重要标志&#xff0c;也是城市管理的重要内容。随着城市化进程的加快&#xff0c;环卫作业范围不断扩大&#xff0c;环卫车辆数量不断增加&#xff0c;传统的管理模式已难以满足现代化城市管理的需求。为提高环卫作业效率&#xff0c;加强环…

    GIS 数据质检:验证 Geometry 有效性

    前言 在GIS开发中&#xff0c;数据的几何有效性直接影响分析结果的准确性。无效的几何&#xff08;如自相交、空洞或坐标错误&#xff09;可能导致空间计算失败或输出偏差。无论是Shapefile、GeoJSON还是数据库中的空间数据&#xff0c;几何质检都是数据处理中不可忽视的关键步…