AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1593881
Accepted
Madhubala
Madhubala
Asked: 2020-10-13 22:19:08 +0800 CST2020-10-13 22:19:08 +0800 CST 2020-10-13 22:19:08 +0800 CST

如何按磁盘上存在的顺序打印分区列表(Manjaro linux)

  • 772

Sda 是这样分区的:

在此处输入图像描述

注意具体顺序:sda11 > sda6 > sda7 > sda9 > ...

想要以相同的顺序打印分区信息并将其存储在文本文件中。

我试过的 -

gdisk -l /dev/sda

[manjaro@manjaro-10ahs0wn00 ~]$ sudo gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.5

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 500118192 sectors, 238.5 GiB
Model: Lexar 256GB SSD 
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): F07CA5E4-85FA-F247-855D-4DB101931C1C
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 500118158
Partitions will be aligned on 1-sector boundaries
Total free space is 135154 sectors (66.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1        19255304       500118143   229.3 GiB   8300  STATE
   2         2117638         2183173   32.0 MiB    7F00  KERN-A
   3        10866696        19255303   4.0 GiB     7F01  ROOT-A
   4         2183174         2248709   32.0 MiB    7F00  KERN-B
   5         2478088        10866695   4.0 GiB     7F01  ROOT-B
   6           16448           16448   512 bytes   7F00  KERN-C
   7           16456         2113607   1024.0 MiB  7F01  ROOT-C
   8         2248712         2281479   16.0 MiB    8300  OEM
   9         2113608         2113608   512 bytes   7F02  reserved
  10         2113609         2113609   512 bytes   7F02  reserved
  11              64           16447   8.0 MiB     FFFF  RWFW
  12         2412552         2478087   32.0 MiB    EF00  EFI-SYSTEM

fdisk -l /dev/sda

[manjaro@manjaro-10ahs0wn00 ~]$ sudo fdisk -l /dev/sda
[sudo] password for manjaro: 
Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: Lexar 256GB SSD 
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: F07CA5E4-85FA-F247-855D-4DB101931C1C

Device        Start       End   Sectors   Size Type
/dev/sda1  19255304 500118143 480862840 229.3G Linux filesystem
/dev/sda2   2117638   2183173     65536    32M ChromeOS kernel
/dev/sda3  10866696  19255303   8388608     4G ChromeOS root fs
/dev/sda4   2183174   2248709     65536    32M ChromeOS kernel
/dev/sda5   2478088  10866695   8388608     4G ChromeOS root fs
/dev/sda6     16448     16448         1   512B ChromeOS kernel
/dev/sda7     16456   2113607   2097152     1G ChromeOS root fs
/dev/sda8   2248712   2281479     32768    16M Linux filesystem
/dev/sda9   2113608   2113608         1   512B ChromeOS reserved
/dev/sda10  2113609   2113609         1   512B ChromeOS reserved
/dev/sda11       64     16447     16384     8M unknown
/dev/sda12  2412552   2478087     65536    32M EFI System

Partition table entries are not in disk order.

sfdisk -d /dev/sda

[manjaro@manjaro-10ahs0wn00 ~]$ sudo sfdisk -d /dev/sda
[sudo] password for manjaro: 
label: gpt
label-id: F07CA5E4-85FA-F247-855D-4DB101931C1C
device: /dev/sda
unit: sectors
first-lba: 34
last-lba: 500118158
sector-size: 512

/dev/sda1 : start=    19255304, size=   480862840, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=0D2E3A01-7890-074A-9801-9407ED8D90E3, name="STATE"
/dev/sda2 : start=     2117638, size=       65536, type=FE3A2A5D-4F32-41A7-B725-ACCC3285A309, uuid=417541BD-8D79-A34C-AE63-CB8B79BE3D03, name="KERN-A", attrs="GUID:48,49,50,51,52,53,54,55"
/dev/sda3 : start=    10866696, size=     8388608, type=3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC, uuid=C9D9828E-5FC8-9A42-A6A0-6E64FF8F3383, name="ROOT-A"
/dev/sda4 : start=     2183174, size=       65536, type=FE3A2A5D-4F32-41A7-B725-ACCC3285A309, uuid=3E6C72E3-744D-1B40-825D-570F4D1CB0DF, name="KERN-B", attrs="GUID:52,53,54,55"
/dev/sda5 : start=     2478088, size=     8388608, type=3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC, uuid=4393B767-9292-3E4F-BC6A-FFCB3BB76B4C, name="ROOT-B"
/dev/sda6 : start=       16448, size=           1, type=FE3A2A5D-4F32-41A7-B725-ACCC3285A309, uuid=A2E8DF92-A885-D64A-9DCE-109DFD3A912D, name="KERN-C", attrs="GUID:52,53,54,55"
/dev/sda7 : start=       16456, size=     2097152, type=3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC, uuid=105C4E07-0CD3-9A4D-8C31-E3D75A0B80AF, name="ROOT-C"
/dev/sda8 : start=     2248712, size=       32768, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=D80BFCAD-4771-6C48-9DBB-0ADFBE10DBF1, name="OEM"
/dev/sda9 : start=     2113608, size=           1, type=2E0A753D-9E48-43B0-8337-B15192CB1B5E, uuid=6D272F77-489E-E94A-B903-59BFD612F648, name="reserved"
/dev/sda10 : start=     2113609, size=           1, type=2E0A753D-9E48-43B0-8337-B15192CB1B5E, uuid=E0C92DB9-1C4D-9B4C-92C6-D002B685E39C, name="reserved"
/dev/sda11 : start=          64, size=       16384, type=CAB6E88E-ABF3-4102-A07A-D4BB9BE3C1D3, uuid=E9016D9E-426D-434E-ABA0-614273D7BA5A, name="RWFW"
/dev/sda12 : start=     2412552, size=       65536, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=EE625F5C-40D7-614D-80A3-0C4DA423711B, name="EFI-SYSTEM"

sfdisk /dev/sda

[manjaro@manjaro-10ahs0wn00 ~]$ sudo sfdisk /dev/sda

Welcome to sfdisk (util-linux 2.36).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Checking that no-one is using this disk right now ... OK

Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: Lexar 256GB SSD 
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: F07CA5E4-85FA-F247-855D-4DB101931C1C

Old situation:

Device        Start       End   Sectors   Size Type
/dev/sda1  19255304 500118143 480862840 229.3G Linux filesystem
/dev/sda2   2117638   2183173     65536    32M ChromeOS kernel
/dev/sda3  10866696  19255303   8388608     4G ChromeOS root fs
/dev/sda4   2183174   2248709     65536    32M ChromeOS kernel
/dev/sda5   2478088  10866695   8388608     4G ChromeOS root fs
/dev/sda6     16448     16448         1   512B ChromeOS kernel
/dev/sda7     16456   2113607   2097152     1G ChromeOS root fs
/dev/sda8   2248712   2281479     32768    16M Linux filesystem
/dev/sda9   2113608   2113608         1   512B ChromeOS reserved
/dev/sda10  2113609   2113609         1   512B ChromeOS reserved
/dev/sda11       64     16447     16384     8M unknown
/dev/sda12  2412552   2478087     65536    32M EFI System

Partition table entries are not in disk order.

Type 'help' to get more information.

>>> ^C

sfdisk -l /dev/sda

[manjaro@manjaro-10ahs0wn00 ~]$ sudo sfdisk -l /dev/sda
[sudo] password for manjaro: 
Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: Lexar 256GB SSD 
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: F07CA5E4-85FA-F247-855D-4DB101931C1C

Device        Start       End   Sectors   Size Type
/dev/sda1  19255304 500118143 480862840 229.3G Linux filesystem
/dev/sda2   2117638   2183173     65536    32M ChromeOS kernel
/dev/sda3  10866696  19255303   8388608     4G ChromeOS root fs
/dev/sda4   2183174   2248709     65536    32M ChromeOS kernel
/dev/sda5   2478088  10866695   8388608     4G ChromeOS root fs
/dev/sda6     16448     16448         1   512B ChromeOS kernel
/dev/sda7     16456   2113607   2097152     1G ChromeOS root fs
/dev/sda8   2248712   2281479     32768    16M Linux filesystem
/dev/sda9   2113608   2113608         1   512B ChromeOS reserved
/dev/sda10  2113609   2113609         1   512B ChromeOS reserved
/dev/sda11       64     16447     16384     8M unknown
/dev/sda12  2412552   2478087     65536    32M EFI System

Partition table entries are not in disk order.

从输出中可以清楚地看出,我尝试过的所有命令都按顺序排列分区编号,而不是显示分区的实际顺序,即 11>6>7>9>...

使用 Manjaro linux

我的问题是如何以相同的顺序打印分区?

linux hard-drive
  • 1 1 个回答
  • 1684 Views

1 个回答

  • Voted
  1. Best Answer
    lin
    2020-10-13T23:08:43+08:002020-10-13T23:08:43+08:00

    尝试sudo parted -l

    一些结果可以在这里看到 https://unix.stackexchange.com/questions/364164/fdisk-partition-table-not-in-disk-order-but-order-is-correct-already-and-g

    • 0

相关问题

  • 对于 cp 或 mv,是否有等同于 cd - 的东西?

  • 以 root 身份运行 docker 容器

  • “写悬崖”现象是否只发生在SSD盘上?

  • 如何在域和 Linux 活动目录中启用指纹传感器

  • 如何在CentOS 7 中将Ctrl+C 永久更改为Ctrl+K?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    v15 为什么通过电缆(同轴电缆)的千兆位/秒 Internet 连接不能像光纤一样提供对称速度? 2020-01-25 08:53:31 +0800 CST
  • Martin Hope
    fixer1234 “HTTPS Everywhere”仍然相关吗? 2019-10-27 18:06:25 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve