马学刚 發表於 2023-11-29 00:00:00

Centos5给/根分区扩容

<p>
        终于还是找到了.现在将执行代码贴出来.希望对大家有帮助!</p>
<p>
        <span># fdisk /dev/hda3</span></p>
<p>
        The number of cylinders for this disk is set to 3916.<br>
        There is nothing wrong with that, but this is larger than 1024,<br>
        and could in certain setups cause problems with:<br>
        1) software that runs at boot time (e.g., old versions of LILO)<br>
        2) booting and partitioning software from other OSs<br>
        (e.g., DOS FDISK, OS/2 FDISK)<br><br><span>Command (m for help): p</span></p>
<p>
        Disk /dev/hda4: 32.2 GB, 32212254720 bytes<br>
        255 heads, 63 sectors/track, 3916 cylinders<br>
        Units = cylinders of 16065 * 512 = 8225280 bytes<br>
        Disk identifier: 0×000bc363</p>
<p>
        Device Boot Start End Blocks Id System<br>
        /dev/hda1 * 1 25 200781 83 Linux<br>
        /dev/hda2 26 1958 15526822+ 8e Linux LVM<br>
        /dev/hda3 1959 2610 5237190 8e Linux LVM</p>
<p>
        <span>Command (m for help): n</span><br>
        Command action<br>
        e extended<br>
        p primary partition (1-4)<br><br>
        Selected partition 4<br>
        First cylinder (2611-3916, default 2611):<br>
        Using default value 2611<br>
        Last cylinder or +size or +sizeM or +sizeK (2611-3916, default 3916):<br>
        Using default value 3916</p>
<p>
        <span>Command (m for help): t</span><br><span>Partition number (1-4): 4</span><br><span>Hex code (type L to list codes): 8e</span><br>
        Changed system type of partition 4 to 8e (Linux LVM)</p>
<p>
        <span>Command (m for help): p</span></p>
<p>
        Disk /dev/hda: 32.2 GB, 32212254720 bytes<br>
        255 heads, 63 sectors/track, 3916 cylinders<br>
        Units = cylinders of 16065 * 512 = 8225280 bytes<br>
        Disk identifier: 0×000bc363</p>
<p>
        Device Boot Start End Blocks Id System<br>
        /dev/hda1 * 1 25 200781 83 Linux<br>
        /dev/hda2 26 1958 15526822+ 8e Linux LVM<br>
        /dev/hda3 1959 2610 5237190 8e Linux LVM<br>
        /dev/hda4 2611 3916 10490445 8e Linux LVM</p>
<p>
        <span>Command (m for help): w</span><br>
        The partition table has been altered!</p>
<p>
        Calling ioctl() to re-read partition table.</p>
<p>
        WARNING: Re-reading the partition table failed with error 16: Device or resource busy.<br>
        The kernel still uses the old table.<br>
        The new table will be used at the next reboot.<br>
        Syncing disks.</p>
<p>
        (注:建议重启一下CentOS系统)</p>
<p>
        <span># pvcreate /dev/hda3</span><br>
        Physical volume “/dev/hda4″ successfully created<br><span># vgextend VolGroup00 /dev/hda3</span><br>
        Volume group “VolGroup00″ successfully extended<br><span># lvextend -l +100%FREE /dev/VolGroup00/LogVol00</span><br>
        Extending logical volume LogVol00 to 28.25 GB<br>
        Logical volume LogVol00 successfully resized<br>
        # lvresize -l +100%FREE /dev/VolGroup00/LogVol00<br>
        New size (904 extents) matches existing size (904 extents)<br>
        lvresize: Resize a logical volume</p>
<p>
        lvresize<br>
        [-A|--autobackup y|n]<br>
        [--alloc AllocationPolicy]<br>
        [-d|--debug]<br>
        [-h|--help]<br>
        [-i|--stripes Stripes [-I|--stripesize StripeSize]]<br>
        {-l|–extents [+|-]LogicalExtentsNumber[%{VG|LV|FREE}] |<br>
        -L|–size [+|-]LogicalVolumeSize}<br>
        [-n|--nofsck]<br>
        [-r|--resizefs]<br>
        [-t|--test]<br>
        [--type VolumeType]<br>
        [-v|--verbose]<br>
        [--version]<br>
        LogicalVolume [ PhysicalVolumePath... ]</p>
<p>
        <span># resize2fs /dev/VolGroup00/LogVol00</span><br>
        resize2fs 1.40.2 (12-Jul-2007)<br>
        Filesystem at /dev/VolGroup00/LogVol00 is mounted on /; on-line resizing required<br>
        old desc_blocks = 2, new_desc_blocks = 2<br>
        Performing an on-line resize of /dev/VolGroup00/LogVol00 to 7405568 (4k) blocks.<br>
        The filesystem on /dev/VolGroup00/LogVol00 is now 7405568 blocks long.</p>
頁: [1]
查看完整版本: Centos5给/根分区扩容