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 / 问题 / 798677
Accepted
Debianuser
Debianuser
Asked: 2016-08-24 12:04:37 +0800 CST2016-08-24 12:04:37 +0800 CST 2016-08-24 12:04:37 +0800 CST

Centos 5 上的 4 TB 外部磁盘

  • 772

我有一台运行 CentOS 5(内核 2.6.18-92.el5)的旧服务器。它正在运行一个遗留应用程序,所以我还不能退役它。我已将 2 TB USB 磁盘连接到它以进行备份,并且该磁盘现在几乎已满。

我买了一个新的 4 TB 磁盘,但操作系统只检测到它为 2 TB。我知道 fdisk 不支持 2TB 以上的分区,但我也没有使用 parted 的运气。

有什么解决方法可以让操作系统读取 4 TB 的全部空间?

来自 dmesg:

usb-storage: device found at 15
usb-storage: waiting for device to settle before scanning
  Vendor: Seagate   Model: Backup+  Desk     Rev: 040B
  Type:   Direct-Access                      ANSI SCSI revision: 06
sdc: Spinning up disk....ready
sdc : very big device. try to use READ CAPACITY(16).
sdc : READ CAPACITY(16) failed.
sdc : status=0, message=00, host=5, driver=00 
sdc : use 0xffffffff as device size
SCSI device sdc: 4294967296 512-byte hdwr sectors (2199023 MB)

分开 /dev/sdc 打印

Model: Seagate Backup+ Desk (scsi)
Disk /dev/sdc: 2199GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      17.4kB  2100GB  2100GB               primary       

Information: Don't forget to update /etc/fstab, if necessary.
partition fdisk parted centos5
  • 2 2 个回答
  • 1710 Views

2 个回答

  • Voted
  1. Ryan Babchishin
    2016-08-24T12:14:52+08:002016-08-24T12:14:52+08:00

    确保使用ext3文件系统或支持 2TB 以上的文件系统。

    使用以下命令创建大于 2TB 的分区 (GPT) 的说明parted:

    https://sakafi.wordpress.com/2008/08/23/how-to-use-parted-for-creating-patition-larger-that-2-tb/

    网站的副本以防它消失:

    To create partitions larger than 2TB we need to use GPT labels. Standard fdisk doesn’t understand GPT labels so we need to use parted.
    
    Here we are going to partition the disk /dev/sdb
    
    root@localhost ~> parted /dev/sdb
    
    This will bring up parted.  Type help to view the commands in parted prompt.
    
    (parted) help
    check NUMBER                             do a simple check on the file system
    cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER   copy file system to another partition
    help [COMMAND]                           prints general help, or help on COMMAND
    mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
    mkfs NUMBER FS-TYPE                      make a FS-TYPE file system on partititon NUMBER
    mkpart PART-TYPE [FS-TYPE] START END     make a partition
    mkpartfs PART-TYPE FS-TYPE START END     make a partition with a file system
    move NUMBER START END                    move partition NUMBER
    name NUMBER NAME                         name partition NUMBER as NAME
    print [free|NUMBER|all]                  display the partition table, a partition, or all devices
    quit                                     exit program
    rescue START END                         rescue a lost partition near START and END
    resize NUMBER START END                  resize partition NUMBER and its file system
    rm NUMBER                                delete partition NUMBER
    select DEVICE                            choose the device to edit
    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                                  displays the current version of GNU Parted and copyright information
    
    root@localhost ~> parted /dev/sdb
    GNU Parted 1.8.1
    Using /dev/sdb
    Welcome to GNU Parted! Type ‘help’ to view a list of commands.
    (parted)
    
    To change the label to gpt we run the following command:
    
    (parted) mklabel gpt
    
    Next run the print command: This will list the disk geometry. Please note the size listed:
    
    (parted) print
    
    Model: Adaptec raid5-1 (scsi)
    Disk /dev/sdb: 10.7TB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    
    Number  Start   End     Size    File system  Name     Flags
    This will tell us where to start and end the partitions. To create one huge partition ( 8 Tb = 8388608 bytes) run the following commands:
    
    (parted) mkpart primary 0 8388607.000
    
    The command reads as make a primary partition, start at 0 and end at 8388607.000
    
    Also, if you are making a partition for a device smaller than the limit from the notes below, you can use the following if the geometry doesn’t show like it does above. Just exit out of parted, and run this from a shell:
    
    root@localhost ~> parted -s — /dev/sdb  mkpart primary ext3 0 -1
    
    This will take the whole disk for creating the partition.
    
    The parition has been created and now you can quit parted:
    (parted) quit
    
    Now all that has to be done is to format the partition:(the -m swith tells mkfs to only reserve 1% of the blocks for the super block)
    
    root@localhost ~> mkfs.ext3 -m1 /dev/sdb1
    mke2fs 1.39 (29-May-2006)
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    1024000000 inodes, 2047999751 blocks
    20479997 blocks (1.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=4294967296
    62500 block groups
    32768 blocks per group, 32768 fragments per group
    16384 inodes per group
    Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
    102400000, 214990848, 512000000, 550731776, 644972544, 1934917632
    
    Writing inode tables: done
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done
    
    This filesystem will be automatically checked every 38 mounts or
    180 days, whichever comes first.  Use tune2fs -c or -i to override.
    
    Mount the disk
    
    root@localhost ~> mount /dev/sdb1 /disk1
    
    root@localhost ~> df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/sda3             240G  2.3G  225G   2% /
    /dev/sda1             996M   45M  900M   5% /boot
    tmpfs                 2.0G     0  2.0G   0% /dev/shm
    /dev/sdb1             7.6T  177M  7.5T   1% /disk1
    
    • 0
  2. Best Answer
    Debianuser
    2016-08-26T03:26:23+08:002016-08-26T03:26:23+08:00

    看起来我至少需要 2.6.32 内核来支持更大的磁盘。我的服务器目前有 2.6.18-92.el5:https ://unix.stackexchange.com/questions/150699/harddisk-not-recognized-filesystem-too-large-to-mount-safely-on-this-system

    具有旧版 BIOS 和 MBR 分区表方案的较旧 Linux 内核版本(所有 2.4 和 2.6.32 之前)计算环境在 2.19 TB 时遇到障碍,因为它们最多只能处理 232 个逻辑块。请务必使用包含对大于 2.19TB 驱动器的支持的内核。2010 年 4 月之后发布的内核支持使用 4096 扇区大小的大容量驱动器。

    • 0

相关问题

  • 主分区与扩展分区

  • 在 Ubuntu 上将 Windows 磁盘分区与 Linux 分区合并

  • 用于 Web 应用服务器的 FreeBSD 磁盘分区(Apache/MySQL/PHP)

  • 调整分区大小通常会扩展文件系统上已用空间的现有大小吗?[关闭]

  • 如何在 Ubuntu 上挂载 LVM 分区?

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