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 / 问题

问题[fdisk](server)

Martin Hope
Someone Sometime
Asked: 2022-01-30 13:27:41 +0800 CST

parted和fdisk的不同输出

  • 1

我有一个奇怪的 CentOS 行为,当我parted -l在服务器上键入命令时,我得到以下结果:

Model: DELL PERC H730P Adp (scsi)
Disk /dev/sda: 5758GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: pmbr_boot

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  3146kB  2097kB                        bios_grub
 2      3146kB  1077MB  1074MB  ext4
 3      1077MB  5749GB  5748GB  ext4
 4      5749GB  5758GB  8590MB  linux-swap(v1)

一切似乎都很好,但是当我检查时,fdisk -l我得到了:

Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: gpt
Disk identifier: 79700B71-AB44-4ED5-95EC-0FE5E3C0CF1D


#         Start          End    Size  Type            Name
 1         2048         6143      2M  BIOS boot       
 2         6144      2103295      1G  Microsoft basic 
 3      2103296  11229198335    5.2T  Microsoft basic 
 4  11229198336  11245975551      8G  Linux swap      

正如你所看到的,文件系统的类型在每种情况下都是不同的,这让我很困扰。
谁能解释一下是什么导致输出结果如此多样化?
提前致谢

fdisk parted table-partitioning
  • 1 个回答
  • 56 Views
Martin Hope
HCSF
Asked: 2021-02-10 23:01:41 +0800 CST

10TB硬盘分区失败?

  • 2

在我再次尝试对 10TB 硬盘进行分区之前,parted看到了它:

# parted /dev/sdb
(parted) print list                                                       
Model: ATA ST10000NM0016-1T (scsi)
Disk /dev/sdb: 10.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  10.0TB  10.0TB  xfs          primary
....
....
....

然后,我只是尝试再次分区但失败了:

[root@localhost ~]# parted /dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(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? Yes
Error: end of file while reading /dev/sdb
Retry/Ignore/Cancel? Retry                                                
Error: end of file while reading /dev/sdb
Retry/Ignore/Cancel? Cancel                                               
(parted) q                                                                
Warning: Error fsyncing/closing /dev/sdb: Input/output error
Retry/Ignore? Retry                                                       
Warning: Error fsyncing/closing /dev/sdb: Input/output error
Retry/Ignore? Ignore                                                      

然后,驱动消失了。我试图重新启动,但仍然看不到驱动器。

这篇文章建议使用gdisk /dev/sdb. 但是,我认为它已经损坏到gdisk无法识别:

# gdisk -l /dev/sdb
GPT fdisk (gdisk) version 0.8.10

Problem opening /dev/sdb for reading! Error is 2.
The specified file does not exist!

lsbk的输出:

# lsblk 
NAME                 MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                    8:0    1 447.1G  0 disk 
├─sda1                 8:1    1     2G  0 part /boot
└─sda2                 8:2    1 445.1G  0 part 
  ├─centos-root      253:0    0    30G  0 lvm  /
  ├─centos-swap      253:1    0     4G  0 lvm  [SWAP]
  ├─centos-var       253:2    0    30G  0 lvm  /var
  ├─centos-coredumps 253:3    0    30G  0 lvm  /coredumps
  └─centos-latest    253:4    0 351.1G  0 lvm  /latest

ls -ltr /dev/sd*的输出:

brw-rw---- 1 root disk 8, 0 Feb 10 16:00 /dev/sda
brw-rw---- 1 root disk 8, 2 Feb 10 16:00 /dev/sda2
brw-rw---- 1 root disk 8, 1 Feb 10 16:00 /dev/sda1

lshw -class disk,parted -l也fdisk -l看不到驱动器。

我看到一些可疑的东西dmesg:

[Wed Feb 10 13:27:39 2021] ata13: softreset failed (1st FIS failed)
[Wed Feb 10 13:27:49 2021] ata13: softreset failed (device not ready)
[Wed Feb 10 13:28:06 2021] ata13: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[Wed Feb 10 13:28:11 2021] ata13.00: qc timeout (cmd 0xec)
[Wed Feb 10 13:28:11 2021] ata13.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[Wed Feb 10 13:28:17 2021] ata13: link is slow to respond, please be patient (ready=0)
[Wed Feb 10 13:28:21 2021] ata13: softreset failed (device not ready)
[Wed Feb 10 13:28:31 2021] ata13: softreset failed (1st FIS failed)
[Wed Feb 10 13:28:41 2021] ata13: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[Wed Feb 10 13:28:51 2021] ata13.00: qc timeout (cmd 0xec)
[Wed Feb 10 13:28:51 2021] ata13.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[Wed Feb 10 13:28:51 2021] ata13: limiting SATA link speed to 3.0 Gbps
[Wed Feb 10 13:28:52 2021] ata13: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
[Wed Feb 10 13:29:13 2021] ata13.00: qc timeout (cmd 0x47)
[Wed Feb 10 13:29:13 2021] ata13.00: READ LOG DMA EXT failed, trying unqueued
[Wed Feb 10 13:29:13 2021] ata13.00: failed to get NCQ Send/Recv Log Emask 0x40
[Wed Feb 10 13:29:13 2021] ata13.00: ATA-10: ST10000NM0016-1TT101, SNE0, max UDMA/133
[Wed Feb 10 13:29:13 2021] ata13.00: 19532873728 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[Wed Feb 10 13:29:13 2021] ata13.00: failed to set xfermode (err_mask=0x40)
[Wed Feb 10 13:29:13 2021] ata13.00: disabled
[Wed Feb 10 13:29:13 2021] ata13: hard resetting link
[Wed Feb 10 13:29:23 2021] ata13: softreset failed (1st FIS failed)
[Wed Feb 10 13:29:23 2021] ata13: hard resetting link
[Wed Feb 10 13:29:33 2021] ata13: softreset failed (device not ready)
[Wed Feb 10 13:29:33 2021] ata13: hard resetting link
[Wed Feb 10 13:29:39 2021] ata13: link is slow to respond, please be patient (ready=0)
[Wed Feb 10 13:29:49 2021] ata13: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
[Wed Feb 10 13:29:49 2021] ata13: EH complete

==================================

更新#1

我看了这篇文章然后关机了acpi,另一篇文章提示电源问题所以我关机了tune-adm。然后,磁盘回来了,我就像上次一样运行,但这一次,没有parted /dev/sdb,但是当我继续时 ,它给了我。我重新启动机器并再次尝试:mklabel gptError: end of file while reading /dev/sdbmkpart primary xfs 0% 1%Error: /dev/sdb: unrecognised disk label

(parted) mkpart primary xfs 0% 1%                                         
(parted) mkpart primary xfs 1% 2%                                         
(parted) mkpart primary ext4 2% 3%                                        
(parted) mkpart primary ext4 3% 4%
(parted) mkpart primary btrfs 4% 5%                                       
(parted) mkpart primary btrfs 5% 6%                                       
(parted) mkpart primary xfs 6% 100%                                       
(parted) print                                                            
Model: ATA ST10000NM0016-1T (scsi)
Disk /dev/sdb: 10.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  100GB   100GB   xfs          primary
 2      100GB   200GB   100GB                primary
 3      200GB   300GB   100GB                primary
 4      300GB   400GB   100GB                primary
 5      400GB   500GB   100GB                primary
 6      500GB   600GB   100GB                primary
 7      600GB   10.0TB  9401GB               primary

(parted) q                                                                

有用。但这似乎很不稳定。我dmesg再次检查,发现类似但不同的故障:

[Thu Feb 11 00:58:31 2021] ata15.00: qc timeout (cmd 0xec)
[Thu Feb 11 00:58:31 2021] ata15.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[Thu Feb 11 00:58:32 2021] ata15: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[Thu Feb 11 00:58:42 2021] ata15.00: qc timeout (cmd 0xec)
[Thu Feb 11 00:58:42 2021] ata15.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[Thu Feb 11 00:58:42 2021] ata15: limiting SATA link speed to 3.0 Gbps
[Thu Feb 11 00:58:44 2021] ata15: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
[Thu Feb 11 00:59:12 2021] ata15.00: ATA-10: ST10000NM0016-1TT101, SNE0, max UDMA/133
[Thu Feb 11 00:59:12 2021] ata15.00: 19532873728 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[Thu Feb 11 00:59:12 2021] ata15.00: configured for UDMA/133
[Thu Feb 11 00:59:12 2021] scsi 14:0:0:0: Direct-Access     ATA      ST10000NM0016-1T SNE0 PQ: 0 ANSI: 5
[Thu Feb 11 00:59:12 2021] sd 14:0:0:0: [sdb] 19532873728 512-byte logical blocks: (10.0 TB/9.09 TiB)
[Thu Feb 11 00:59:12 2021] sd 14:0:0:0: [sdb] 4096-byte physical blocks
[Thu Feb 11 00:59:12 2021] sd 14:0:0:0: [sdb] Write Protect is off
[Thu Feb 11 00:59:12 2021] sd 14:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[Thu Feb 11 00:59:12 2021] sd 14:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[Thu Feb 11 00:59:19 2021]  sdb:
[Thu Feb 11 00:59:19 2021] sd 14:0:0:0: [sdb] Attached SCSI removable disk
[Thu Feb 11 00:59:37 2021] SGI XFS with ACLs, security attributes, no debug enabled

知道发生了什么吗?

谢谢。

hard-drive xfs centos7 fdisk parted
  • 2 个回答
  • 421 Views
Martin Hope
sheffadmin
Asked: 2020-12-02 14:23:43 +0800 CST

parted + 使用帮助未描述 resizepart

  • 0

我们需要在 rhel server 7.2 版本上使用 parted 命令作为示例

parted -s /dev/sda resizepart 2

但是从分开的帮助中我们找不到选项resizepart

例子:

parted -s /dev/sda resizepart 2
Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]
Apply COMMANDs with PARAMETERS to DEVICE.  If no COMMAND(s) are given, run in
interactive mode.

OPTIONs:
  -h, --help                      displays this help message
  -l, --list                      lists partition layout on all block devices
  -m, --machine                   displays machine parseable output
  -s, --script                    never prompts for user intervention
  -v, --version                   displays the version
  -a, --align=[none|cyl|min|opt]  alignment for new partitions

COMMANDs:
  align-check TYPE N                        check partition N for TYPE(min|opt) alignment
  help [COMMAND]                           print general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table, available devices, free space, all found partitions, or a particular partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and copyright information of GNU Parted

我们的版本是'

parted --version
parted (GNU parted) 3.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by <http://git.debian.org/?p=parted/parted.git;a=blob_plain;f=AUTHORS>.

使用帮助是否可能或错误?

还是真的resizepart不支持?

参考 - https://access.redhat.com/sites/default/files/attachments/parted_0.pdf

https://bugzilla.redhat.com/show_bug.cgi?id=1423357

redhat partition lvm fdisk parted
  • 1 个回答
  • 576 Views
Martin Hope
sheffadmin
Asked: 2020-11-28 02:14:10 +0800 CST

增加 OS VM 磁盘并重新扫描后,rhel + parted 失败

  • 0

我们有 VM rhel 机器版本 7.6

来自 lsblk 的示例

lsblk
NAME             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
fd0                2:0    1     4K  0 disk
sda                8:0    0   300G  0 disk
├─sda1             8:1    0   500M  0 part /boot
├─sda2             8:2    0  39.5G  0 part
│ ├─VG-RHEL_root 253:0    0  40.9G  0 lvm  /
│ ├─VG-RHEL_swap 253:1    0   7.7G  0 lvm  [SWAP]
│ └─VG-RHEL_var  253:2    0 100.9G  0 lvm  /var
└─sda3             8:3    0   110G  0 part
  ├─VG-RHEL_root 253:0    0  40.9G  0 lvm  /
  └─VG-RHEL_var  253:2    0 100.9G  0 lvm  /var

在使用分开之前

我们将 vsphare 客户端的 OS 磁盘从 200G 增加到 300G

然后我们重新扫描 sda 磁盘,我们得到 lsblk 300 而不是之前的 200G

现在我们想使用parted

但我们得到以下

  parted /dev/sda  resizepart 2 100%
Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]
Apply COMMANDs with PARAMETERS to DEVICE.  If no COMMAND(s) are given, run in
interactive mode.
 
OPTIONs:
  -h, --help                      displays this help message
  -l, --list                      lists partition layout on all block devices
  -m, --machine                   displays machine parseable output
  -s, --script                    never prompts for user intervention
  -v, --version                   displays the version
  -a, --align=[none|cyl|min|opt]  alignment for new partitions

这里有什么问题?

linux redhat lvm fdisk parted
  • 1 个回答
  • 100 Views
Martin Hope
sheffadmin
Asked: 2020-11-16 09:00:26 +0800 CST

扩展 VM 磁盘大小后如何增加 LVM 中卷组中的可用空间

  • 0

我们想在我们的 VM centOS 服务器中增加卷组中的空间

例如

从pvs我们看到

pvs
  PV         VG   Fmt  Attr PSize    PFree
  /dev/sda2  VLwol lvm2 a--  <100.00g <5.09g

主要目标是在 PFree 下具有值 - 300g

例子

pvs
  PV         VG   Fmt  Attr PSize    PFree
  /dev/sda2  VLwol lvm2 a--  <400.00g <305g

所以首先我们从 Vsphaere 客户端将 OS 磁盘增加 + 300g

然后我们重新扫描磁盘

 echo 1>/sys/class/block/sda/device/rescan

从这一点来看,为了增加卷组中的可用空间,最好的建议方法是什么?

linux vmware-server lvm vmware-vsphere fdisk
  • 1 个回答
  • 473 Views
Martin Hope
sheffadmin
Asked: 2020-11-16 00:37:54 +0800 CST

增加 OS 磁盘大小后添加额外的分区

  • 0

作为添加额外分区的一部分 – sda3 我们将操作系统磁盘从 vsphere 客户端(VM Linux 服务器)从 50g 扩展到 120g

我们执行重新扫描,而不是重新启动

lsblk
NAME             MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                8:0    0  120G  0 disk
├─sda1             8:1    0    1G  0 part /boot
└─sda2             8:2    0  119G  0 part
  ├─Vlpr-lvm_root 253:0    0   10G  0 lvm  /
  ├─Vlpr-lvm_swap 253:1    0  3.9G  0 lvm  [SWAP]
  └─Vlpr-lvm_var  253:2    0  10G  0 lvm  /var


fdisk /dev/sda

Command (m for help): n
Partition type:
   p   primary (2 primary, 0 extended, 2 free)
   e   extended
Select (default p): p0
Partition number (3,4, default 3): 3
No free sectors available

Command (m for help):

正如我们在上面看到的,我们有分区 - sda1 sda2 ,但是当我们从 fdisk 中选择分区号 - 3 时,它会抱怨 -No free sectors available 尽管我们没有使用 sda3

为什么 fdisk 给出错误的任何建议 -No free sectors available

我只想提一下,如果这是解决方案,我们宁愿不重新启动?

centos redhat fdisk parted
  • 1 个回答
  • 319 Views
Martin Hope
TenG
Asked: 2020-09-19 16:18:12 +0800 CST

向 Iomega IX2-200 添加了 4Tb 硬盘,但无法扩展卷

  • 1

我有一个带有 2Tb(1.8Tb 可用)空间的 Iomega IX2-200。

它有两个磁盘设置为 RAID1。

我正在尝试将此升级到 4Tb 磁盘。

到目前为止,这是我遵循的过程:

  1. 从 IX2 中移除第二个磁盘,并用 4Tb 磁盘替换它。

  2. IX2 自动开始重新同步/镜像 disk1 (2Tb) 到新的 4Tb 磁盘。

  3. 几个小时后,我们看到秒磁盘为 1.8Tb。

  4. 用另一个 4Tb 驱动器替换第一个磁盘,然后重新启动。

  5. IX2 再次开始将disk2 镜像到disk1。

  6. 几个小时后,我们在 IX2 中有 2 个 4Tb 磁盘,但只有 1.8Tb 可用。

  7. IX2 还没有gdisk安装,所以我移除了磁盘,将它们作为 USB 驱动器连接到 Linux 服务器并运行 gdisk:

gdisk /dev/sdh x e

这使我能够扩展分区(键入 Microsoft 基本数据 0700)。

  1. 对另一个磁盘重复。

  2. 现在将磁盘放回 IX2 并重新启动。

  3. 增大和调整音量:

umount /mnt/pools/A/A0
mdadm --grow /dev/md1 --size=max
pvresize /dev/md1
  1. 检查结果:
    显示器
      --- 卷组 ---
      虚拟机名称 5244dd0f_vg
      系统编号
      lvm2 格式
      元数据区 1
      元数据序列号 6
      VG 访问读/写
      VG 状态可调整大小
      最大低压 0
      电流 LV 1
      打开 LV 0
      最大 PV 0
      当前 PV 1
      行动 PV 1
      VG 大小 3.62 TB
      PE 大小 4.00 MB
      总PE 948739
      分配 PE / 大小 471809 / 1.80 TB
      免费 PE / 大小 476930 / 1.82 TB
      VG UUID FB2tzp-8Gr2-6Dlj-9Dck-Tyc4-Gxx5-HHIsBD

    
      --- 卷组 ---
      VG 名称 md0_vg
      系统编号
      lvm2 格式
      元数据区 1
      元数据序列号 3
      VG 访问读/写
      VG 状态可调整大小
      最大低压 0
      电流 LV 2
      打开LV 2
      最大 PV 0
      当前 PV 1
      行动 PV 1
      VG 大小 20.01 GB
      PE 大小 4.00 MB
      总PE 5122
      分配 PE / 大小 5122 / 20.01 GB
      免费 PE / 尺寸 0 / 0
      VG UUID EA3tJR-nVdm-0Dcf-YtBE-t1Qj-peHc-Sh0zXe
  1. 重启。

  2. 结果 - 仍显示为 1.8Tb:

df -h
已使用的文件系统大小可用使用百分比已安装在
根文件系统 50M 2.5M 48M 5% /
/dev/root.old 6.5M 2.1M 4.4M 33% /initrd
无 50M 2.5M 48M 5% /
/dev/md0_vg/BFDlv 4.0G 607M 3.2G 16% /boot
/dev/loop0 576M 569M 6.8M 99% /mnt/apps
/dev/loop1 4.9M 2.2M 2.5M 47% /etc
/dev/loop2 212K 212K 0 100% /oem
tmpfs 122M 0 122M 0% /mnt/apps/lib/init/rw
tmpfs 122M 0 122M 0% /dev/shm
/dev/mapper/md0_vg-vol1
                       16G 1.2G 15G 8% /mnt/系统
/dev/mapper/5244dd0f_vg-lv58141b0d
                      1.8T 1.7T 152G 92% /mnt/pools/A/A0

我发现了几个具有卷大小的配置文件,所以我编辑了这些:

/etc/sohoProvisioning.xml

增加Size以下标识 2 和 3 的值:

<Partitions>
<Partition Ident="0" Drive="0" Size="21484429312" Device="sda1" SysPartition="1"></Partition>
<Partition Ident="1" Drive="1" Size="21484429312" Device="sdb1" SysPartition="1"></Partition>
<Partition Ident="2" Drive="0" Size="3979300000000" Device="sda2" SysPartition="0"></Partition>
<Partition Ident="3" Drive="1" Size="3979300000000" Device="sdb2" SysPartition="0"></Partition>
</Partitions>

重新启动但仍然只有 1.8Tb 可用。

更新 1

按照我运行的第一个答案建议:

lvresize -l +100%FREE /dev/mapper/5244dd0f_vg-lv58141b0d

然后我跑了:

xfs_growfs  /mnt/pools/A/A0
meta-data=/dev/mapper/5244dd0f_vg-lv58141b0d isize=256    agcount=4, agsize=120783104 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=483132416, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096
log      =internal               bsize=4096   blocks=32768, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0

但数组大小不变:

root@nmsts1:/# mdadm -D /dev/md1
/dev/md1:
        Version : 01.00
  Creation Time : Mon Mar  7 08:45:49 2011
     Raid Level : raid1
     Array Size : 3886037488 (3706.01 GiB 3979.30 GB)
  Used Dev Size : 7772074976 (7412.03 GiB 7958.60 GB)
   Raid Devices : 2
  Total Devices : 1
Preferred Minor : 1
    Persistence : Superblock is persistent

我似乎已经损坏了第二个磁盘,所以阵列只显示 /dev/sda,但即使使用一个磁盘,调整大小也应该有效,不是吗?

mdadm fdisk raid1
  • 5 个回答
  • 1316 Views
Martin Hope
Azize
Asked: 2020-03-26 09:32:28 +0800 CST

没有分区的文件系统

  • 0

为了创建文件系统而创建分区是很常见的。
现代 Linuxfdisk会自动进行块对齐,从扇区开始分区2048。
在这种情况下,文件系统也将从扇区开始2048。下面只是一个例子。

fdisk -l /dev/nvme1n1
Disk /dev/nvme1n1: 5 GiB, 5368709120 bytes, 10485760 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: dos
Disk identifier: 0xc14701c1

Device         Boot Start      End  Sectors Size Id Type
/dev/nvme1n1p1       2048 10485759 10483712   5G 83 Linux

但也可以直接在设备上创建文件系统,无需任何分区。
在这种情况下,文件系统将在哪个块中启动?
它会从扇区开始0吗?如果是这样,是否意味着它默认对齐?

linux filesystems fdisk
  • 1 个回答
  • 1089 Views
Martin Hope
Vagnerr
Asked: 2017-02-18 08:04:49 +0800 CST

硬件 RAID 阵列扩展后 fdisk 不允许我使用其他可用扇区

  • 10

我们在戴尔 R720xd 上有一个约 18TB 的大型硬件 RAID 阵列。目前 RAID5 阵列由 6x4TB 组成,我需要对其进行扩展。

步骤 1 展开硬件 RAID 阵列。

如果您安装了戴尔管理工具,就足够简单了。

omconfig storage vdisk action=reconfigure controller=0 vdisk=1 raid=r5 pdisk=0:1:0,0:1:1,0:1:3,0:1:3,0:1:4,0:1:5,0:1:8,0:1:9

(新磁盘是最后两个,可以使用该omreport工具确认)虽然需要一段时间,但一切都很好,我能够确认阵列已经扩展..

% omreport storage vdisk controller=0 vdisk=1

Virtual Disk 1 on Controller PERC H710P Mini (Embedded)

Controller PERC H710P Mini (Embedded)
ID                                : 1
Status                            : Ok
Name                              : bak
State                             : Ready
Hot Spare Policy violated         : Not Assigned
Encrypted                         : No
Layout                            : RAID-5
Size                              : 26,078.50 GB (28001576157184 bytes)
...
Device Name                       : /dev/sdb
...

Step 2 新建分区

因此,虚拟磁盘现在报告增加的 (26TB) 大小。并且fdisk同意...

Disk /dev/sdb: 25.5 TiB, 28001576157184 bytes, 54690578432 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: A2D20632-37D1-4607-9AA0-B0ED6E457F91

Device     Start         End     Sectors  Size Type
/dev/sdb1   2048 39064698846 39064696799 18.2T Linux LVM

但是,当我去向磁盘添加一个额外的分区时,会发生以下情况......

Command (m for help): n
Partition number (2-128, default 2): 2
First sector (34-2047): 

我现在磁盘上有大约 160 亿个扇区,但我无法使用它们。我只提供扇区 34-2047。即使我目前只设置了一个分区,我也无法分配 8TB 的新空间。

让我感到奇怪的另一件事是,我得到的分区号是 2-128,而不仅仅是 2-4。分区表没有显示任何扩展分区,所以我预计最初会将我限制为 4 个分区。

有什么我想念的吗?

  • 扩展驱动器阵列后,机器已重新启动。在此之前 fdisk 只会报告原始的 18TB
  • 尝试cfdisk仅报告 390 亿范围内的 2015 年可用扇区,尽管总体报告为 25TB。
  • 如果可以避免,我们不想删除并重新创建分区,因为我们可能会丢失所有数据。我们更喜欢在完成后使用新分区简单地扩展 LVM 卷组。
  • 它与另一个服务器故障问题类似,但我不受分区用完的限制,我不认为我受到扩展分区的限制。
  • 它不是由驱动器扩展来扩展扇区大小。如果是 fdisk 就不会报告扇区数的增加,我会想到。另外pvs并且vgs没有在 LVM 下报告任何额外的未分配空间
  • 我在虚拟机上将其作为空运行运行,但没有遇到这种情况。但是我正在关闭虚拟机并增加其磁盘设备大小。所以在大小增加期间它不在线。此外,对于 vm,驱动器大小要小许多数量级。

更新 Micheal 请求的 1 'x'pert 模式输出...

Command (m for help): x

Expert command (m for help): p
Disk /dev/sdb: 25.5 TiB, 28001576157184 bytes, 54690578432 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: A2D20632-37D1-4607-9AA0-B0ED6E457F91
First LBA: 34
Last LBA: 39064698846
Alternative LBA: 39064698879
Partitions entries LBA: 2
Allocated partition entries: 128

Device     Start         End     Sectors Type-UUID                            UUID                                 Name      Attrs
/dev/sdb1   2048 39064698846 39064696799 E6D6D379-F507-44C2-A23C-238F2A3DF928 E9CB58BF-F170-4480-A230-6E2A238367D1 Linux LVM 


Expert command (m for help): v
MyLBA mismatch with real position at backup header.
1 error detected.

那么可能的 LBA 错误?

linux debian dell raid fdisk
  • 2 个回答
  • 2248 Views
Martin Hope
vigilian
Asked: 2016-09-13 08:09:06 +0800 CST

无法格式化内部磁盘

  • 0

我无法格式化从数据中心以二手购买的一堆内部磁盘。磁盘格式化为 NTFS,即 3 2TB seagate constellation ES +2 1TB seagate constellation ES + 1 WDC RE3 1TB。我已经使用 fdisk 为它们中的每一个创建了一个新的分区表(尝试使用 gpt 和 dos)并创建一个新分区。但是每次我尝试格式化为 ext4 时,它都会给我一个错误,例如:

/dev/sdg1 is apparently in use by the system; will not make a filesystem here!

或 gparted 出现未知错误,但如果我在 ntfs 中格式化,那没关系。不能正常吧?我应该怎么办?我在这里有点没有头绪。配置:ubuntu:16.04.1

编辑:向您展示整个过程:

@docker:~$ sudo sfdisk -l /dev/sdh
Disque /dev/sdh : 1,8 TiB, 2000398934016 octets, 3907029168 secteurs
Unités : sectors of 1 * 512 = 512 octets
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0abdc00e
@docker:~$ sudo fdisk /dev/sdh

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


Commande (m pour l'aide) : o
Created a new DOS disklabel with disk identifier 0x18c440ee.

Commande (m pour l'aide) : n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Numéro de partition (1-4, 1 par défaut) : 
Premier secteur (2048-3907029167, 2048 par défaut) : 
Last sector, +sectors or +size{K,M,G,T,P} (2048-3907029167, 3907029167 par défaut) : 

Created a new partition 1 of type 'Linux' and of size 1,8 TiB.

Commande (m pour l'aide) : w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

@docker:~$ sudo mkfs.ext4 /dev/sdh1
mke2fs 1.42.13 (17-May-2015)
/dev/sdh1 est apparemment utilisé par le système ; ne fera pas un système de fichiers ici !
@docker:~$ sudo umount /dev/sdh1
umount: /dev/sdh1: not mounted
vigilian@docker:~$ sudo sfdisk §l /dev/sdh
sfdisk: failed to parse partition number: '/dev/sdh'
vigilian@docker:~$ sudo sfdisk -l /dev/sdh                                                         
Disque /dev/sdh : 1,8 TiB, 2000398934016 octets, 3907029168 secteurs
Unités : sectors of 1 * 512 = 512 octets
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x18c440ee

Périphérique Amorçage Start        Fin   Secteurs  Size Id Type
/dev/sdh1              2048 3907029167 3907027120  1,8T 83 Linux
ubuntu gparted fdisk
  • 2 个回答
  • 922 Views

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