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
    • 最新
    • 标签
主页 / server / 问题 / 531438
Accepted
artfulrobot
artfulrobot
Asked: 2013-08-17 00:56:19 +0800 CST2013-08-17 00:56:19 +0800 CST 2013-08-17 00:56:19 +0800 CST

(Debian) Linux 中的重复分区表

  • 772

软件 RAID 阵列中的磁盘出现故障,我正在尝试更换它。我之前已经顺利完成了这项工作,但这次我在尝试复制分区表时遇到了错误。

我正在使用这个命令:

sfdisk -l /dev/sda | sfdisk /dev/sdb

并得到这个错误:

sfdisk: unrecognized input: 121601 cylinders, 255 heads, 63 sectors/track

阅读sfdisk 手册页,我无法诚实地看到这个命令是如何工作的,但它在过去曾多次工作过。

问题:如何将确切的分区表复制到第二个磁盘,以便我可以将其用作 RAID 成员?我不喜欢 sfdisk,这只是之前完成的工作。

如果有帮助,这里有一些细节

sfdisk -l /dev/sda

Disk /dev/sda: 121601 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1   *      0+   3646    3647-  29294496   fd  Linux raid autodetect
/dev/sda2       3647  121600  117954  947465505    5  Extended
/dev/sda3          0       -       0          0    0  Empty
/dev/sda4          0       -       0          0    0  Empty
/dev/sda5       3647+  27961   24315- 195310206   fd  Linux raid autodetect
/dev/sda6      27962+  40119   12158-  97659103+  fd  Linux raid autodetect
/dev/sda7     120628+ 121600     973-   7815591   fd  Linux raid autodetect
/dev/sda8     119655+ 120627     973-   7815591   fd  Linux raid autodetect
/dev/sda9      40120+ 119654   79535- 638864856   fd  Linux raid autodetect

sfdisk -l /dev/sdb

Disk /dev/sdb: 121601 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdb1          0+ 121600  121601- 976760001   83  Linux
/dev/sdb2          0       -       0          0    0  Empty
/dev/sdb3          0       -       0          0    0  Empty
/dev/sdb4          0       -       0          0    0  Empty

还尝试了该选项的管道-d,但这告诉我:

   Device Boot    Start       End   #sectors  Id  System
/dev/sdb1   *        63  58589054   58588992  fd  Linux raid autodetect
/dev/sdb2      58589055 1953520064 1894931010   5  Extended
/dev/sdb3             0         -          0   0  Empty
/dev/sdb4             0         -          0   0  Empty
/dev/sdb5      58589118 449209529  390620412  fd  Linux raid autodetect
/dev/sdb6     449209593 644527799  195318207  fd  Linux raid autodetect
/dev/sdb7     1937888883 1953520064   15631182  fd  Linux raid autodetect
/dev/sdb8     1922257638 1937888819   15631182  fd  Linux raid autodetect
/dev/sdb9     644527863 1922257574 1277729712  fd  Linux raid autodetect
Warning: partition 7 does not start at a cylinder boundary

sfdisk: I don't like these partitions - nothing changed.
(If you really want this, use the --force option.)

partition7 是否有可能从 sda 的圆柱边界开始,但不会在 sdb 上?我应该修复这个(分开?)还是强制它?

linux
  • 2 2 个回答
  • 1515 Views

2 个回答

  • Voted
  1. dsmsk80
    2013-08-17T01:02:23+08:002013-08-17T01:02:23+08:00

    命令应该是

    sfdisk -d /dev/sda | sfdisk /dev/sdb
    
    • 3
  2. Best Answer
    Janne Pikkarainen
    2013-08-17T01:15:45+08:002013-08-17T01:15:45+08:00

    由于您之前为您工作的命令不再起作用,我有点犹豫是否要告诉您有关克隆 MBR 的信息dd……如果您敢于尝试并完全自担风险,请尝试一下。

    dd if=/dev/sda of=/dev/sdb bs=512 count=1
    
    • 2

相关问题

  • Linux 主机到主机迁移

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 如何在 Linux 下监控每个进程的网络 I/O 使用情况?

  • 在 RHEL4 上修改 CUPS 中的现有打印机设置

  • 为本地网络中的名称解析添加自定义 dns 条目

Sidebar

Stats

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

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve