如何按顺序制作设备分区号(例如:“/dev/sda1 to sda5”}

UnK*_*OWn 5 partitioning

我单独使用 Ubuntu 18.04 操作系统和 GPT 分区样式。

我有好几次安装了双操作系统,删除了一个操作系统等等。
我从不让我的数据被擦除。
在关于这个我只是删除分区一样EFIMSReservedOEM//homeswap等。

我想知道为什么/dev/sda显示如下不规则数字以及如何按顺序排列它们..我想按此顺序查看下表..sda1 sda2 sda3 sda4sda5

Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors  
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: 918BD4B2-E90D-4F50-8E3E-4EFE6B86495D


Device          Start        End   Sectors   Size Type  
/dev/sda1        2048     194559    192512    94M EFI System  
/dev/sda2      194560   65298431  65103872    31G Linux filesystem  
/dev/sda3    65298432  488957951 423659520   202G Linux filesystem  
/dev/sda6   488957952 1221242879 732284928 349.2G Microsoft basic data  
/dev/sda7  1221242880 1953523711 732280832 349.2G Microsoft basic data
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

更新:问题已通过@cras 回答解决。 在此处输入图片说明

cra*_*ass 7

使用sgdiskgdisk包中对条目进行排序。这可以通过发出以下命令来完成。

sgdisk -s /dev/sda
Run Code Online (Sandbox Code Playgroud)
   -s, --sort
Run Code Online (Sandbox Code Playgroud)
          Sort partition entries. GPT partition numbers need not match the
          order of partitions on the disk. If you want them to match,  you
          can use this option.  Note that some partitioning utilities sort
          partitions whenever they make  changes.  Such  changes  will  be
          reflected  in  your  device  filenames,  so you may need to edit
          /etc/fstab if you use this option.
Run Code Online (Sandbox Code Playgroud)