zoukankan      html  css  js  c++  java
  • 记录一次LVM磁盘初始化

    [root@cloud ~]# 

    [root@cloud ~]# fdisk -l

    Disk /dev/sdb: 107.4 GB, 107374182400 bytes
    255 heads, 63 sectors/track, 13054 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000


    Disk /dev/sda: 10.7 GB, 10737418240 bytes
    255 heads, 63 sectors/track, 1305 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00051f5f

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 64 512000 83 Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2 64 1306 9972736 8e Linux LVM

    Disk /dev/mapper/vg_cloud-lv_root: 8128 MB, 8128561152 bytes
    255 heads, 63 sectors/track, 988 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000


    Disk /dev/mapper/vg_cloud-lv_swap: 2080 MB, 2080374784 bytes
    255 heads, 63 sectors/track, 252 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000

    [root@cloud ~]#
    [root@cloud ~]#
    [root@cloud ~]# pvcreate /dev/sdb
    Physical volume "/dev/sdb" successfully created
    [root@cloud ~]# pvdisplay
    --- Physical volume ---
    PV Name /dev/sda2
    VG Name vg_cloud
    PV Size 9.51 GiB / not usable 3.00 MiB
    Allocatable yes (but full)
    PE Size 4.00 MiB
    Total PE 2434
    Free PE 0
    Allocated PE 2434
    PV UUID SS6KHH-VzrH-ecFS-QoYn-Ov0g-u4ZI-Pk4kXL

    "/dev/sdb" is a new physical volume of "100.00 GiB"
    --- NEW Physical volume ---
    PV Name /dev/sdb
    VG Name
    PV Size 100.00 GiB
    Allocatable NO
    PE Size 0
    Total PE 0
    Free PE 0
    Allocated PE 0
    PV UUID JOjFKJ-Q3tW-EYjb-vPDD-Nwpy-eP7B-eLrtYA

    [root@cloud ~]# vgcreate vg_data01 /dev/sdb
    Volume group "vg_data01" successfully created
    [root@cloud ~]# vgdisplay
    --- Volume group ---
    VG Name vg_data01
    System ID
    Format lvm2
    Metadata Areas 1
    Metadata Sequence No 1
    VG Access read/write
    VG Status resizable
    MAX LV 0
    Cur LV 0
    Open LV 0
    Max PV 0
    Cur PV 1
    Act PV 1
    VG Size 100.00 GiB
    PE Size 4.00 MiB
    Total PE 25599
    Alloc PE / Size 0 / 0
    Free PE / Size 25599 / 100.00 GiB
    VG UUID 3lD5Zq-z13B-mrkZ-OY71-yVPb-8ovT-OSzBDP

    --- Volume group ---
    VG Name vg_cloud
    System ID
    Format lvm2
    Metadata Areas 1
    Metadata Sequence No 3
    VG Access read/write
    VG Status resizable
    MAX LV 0
    Cur LV 2
    Open LV 2
    Max PV 0
    Cur PV 1
    Act PV 1
    VG Size 9.51 GiB
    PE Size 4.00 MiB
    Total PE 2434
    Alloc PE / Size 2434 / 9.51 GiB
    Free PE / Size 0 / 0
    VG UUID I5k6GO-mjni-7dO0-O4TF-RcFH-RNcI-bnCFY3

    [root@cloud ~]# lvcreate -L 50G -n data_vol01
    Please provide a volume group name
    Run `lvcreate --help' for more information.
    [root@cloud ~]# lvcreate -L 50G -n data_vol01 vg_data01
    Logical volume "data_vol01" created
    [root@cloud ~]# lvcreate -n log_vol01 vg_data01
    Please specify either size or extents
    Run `lvcreate --help' for more information.
    [root@cloud ~]#
    [root@cloud ~]# mkfs.ext4 /dev/vg_data01/data_vol01
    mke2fs 1.41.12 (17-May-2010)
    文件系统标签=
    操作系统:Linux
    块大小=4096 (log=2)
    分块大小=4096 (log=2)
    Stride=0 blocks, Stripe width=0 blocks
    3276800 inodes, 13107200 blocks
    655360 blocks (5.00%) reserved for the super user
    第一个数据块=0
    Maximum filesystem blocks=4294967296
    400 block groups
    32768 blocks per group, 32768 fragments per group
    8192 inodes per group
    Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624, 11239424

    正在写入inode表: 完成
    Creating journal (32768 blocks): 完成
    Writing superblocks and filesystem accounting information: 完成

    This filesystem will be automatically checked every 35 mounts or
    180 days, whichever comes first. Use tune2fs -c or -i to override.
    [root@cloud ~]#

  • 相关阅读:
    再来五道剑指offer题目
    高强度学习训练第十天总结:Class文件
    windows linux 子系统及windows terminal的使用。
    从植物大战僵尸开始一步一步带你入门逆向工程,
    高强度学习训练第九天总结:5道剑指offer的题目
    高强度学习训练第八天总结:MySQL的一些优化
    JVM的一些工具的简要使用
    手把手教你使用Java实现一个神经网络
    指定路径创建文件,并写入数据
    c#创建windows服务(代码方式安装、启动、停止、卸载服务)
  • 原文地址:https://www.cnblogs.com/longzhu/p/5595369.html
Copyright © 2011-2022 走看看