このコンテンツは選択した言語では利用できません。

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
  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
  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
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat