此内容没有您所选择的语言版本。

4.9. Attaching and Configuring the Data Disk


  1. From the Google Developers Console, click Compute > Compute Engine > VM instances > rhgs-primary-n01 > Attach > rhgs-primary-n01-data.
  2. Choose the mode as Read/write.
  3. Connect to the rhgs-primary-n01 instance via SSH, and configure the data disk:
    # ssh username@instance_external_ip
    Copy to Clipboard Toggle word wrap
  4. Confirm the data disk is visible as /dev/sdb:
    # fdisk -l /dev/sdb
    
    Disk /dev/sdb: 10984.4 GB, 10984378859520 bytes
    255 heads, 63 sectors/track, 1335441 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    Copy to Clipboard Toggle word wrap
  5. Configure LVM, format the filesystem, and mount the data disk:
    The script below can be used to complete this process per documented recommendations.

    Warning

    This script assumes a large enough block device to accommodate the maximum supported metadata LV size of 16 GB for LVM thin provisioning needed for snapshots. You should understand what each step in the script is doing before using it.
    #!/bin/bash
    pvcreate /dev/sdb
    vgcreate rhgs_vg /dev/sdb
    # Create metadata LV with the maximum supported size of 16GB
    lvcreate -L 16777216K --name rhgs_pool_meta rhgs_vg
    # Create data LV with the remainder of the VG space
    lvcreate -l 100%FREE --name rhgs_pool rhgs_vg
    # The lvconvert command below required 4096 free extents, so reduce the LV
    lvreduce -f -l 4096 /dev/rhgs_vg/rhgs_pool
    # Convert our LVs to a thin pool
    lvconvert --yes --thinpool rhgs_vg/rhgs_pool --poolmetadata rhgs_vg/rhgs_pool_meta
    # Disable zeroing of thin pool chunks for performance boost
    lvchange --zero n rhgs_vg/rhgs_pool
    # The -V flag for lvcreate does not allow a ‘100%FREE’ option like -l does.
    # So we’ll get the size of rhgs_pool from lvs for maximum efficiency
    LVSIZE=$(lvs --units g | grep rhgs_pool | awk '{print $4}' | awk -F. '{print $1}')
    # Create the thin LV for the bricks
    lvcreate -V ${LVSIZE}G -T rhgs_vg/rhgs_pool -n rhgs_lv
    # Create the XFS filesystem with 512B inode size and 8KB directory block size
    # This step may take a while...
    mkfs.xfs -f -i size=512 -n size=8192 -L rhgs_lv /dev/rhgs_vg/rhgs_lv
    # Create mountpoint and fstab entry
    mkdir -p /rhgs/bricks
    echo "LABEL=rhgs_lv /rhgs/bricks xfs rw,inode64,noatime,nouuid 1 2" >> /etc/fstab
    mount /rhgs/bricks
    df -h /rhgs/bricks
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat