Centos5 resize/root Partition

Source: Internet
Author: User
Tags hex code

I finally found it. Now I will executeCodePost it. I hope it will help you!

[Root @ localhost ~] # Fdisk/dev/hda3

The number of cylinders for this disk is set to 3916.
There is nothing wrong with that, but this is larger than 1024,
And coshould in certain setups cause problems:
1) software that runs at boot time (e.g., old versions of lilo)
2) booting and partitioning software from other OSS
(E.g., DOS fdisk, OS/2 fdisk)

Command (M for help): p

Disk/dev/hda4: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk identifier: 0 × 000bc363

Device boot start end blocks ID system
/Dev/hda1*1 25 200781 83 Linux
/Dev/hda2 26 1958 15526822 + 8e Linux LVM
/Dev/hda3 1959 2610 5237190 8e Linux LVM

Command (M for help): n
Command action
E extended
P primary partition (1-4)

Selected partition 4
First cylinder (2611-3916, default 2611 ):
Using default value 2611
Last cylinder or + size or + sizem or + sizek (2611-3916, default 3916 ):
Using default value 3916

Command (M for help): T
Partition Number (1-4): 4
HEX Code (type L to list codes): 8E
Changed system type of partition 4 to 8E (Linux LVM)

Command (M for help): p

Disk/dev/hda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk identifier: 0 × 000bc363

Device boot start end blocks ID system
/Dev/hda1*1 25 200781 83 Linux
/Dev/hda2 26 1958 15526822 + 8e Linux LVM
/Dev/hda3 1959 2610 5237190 8e Linux LVM
/Dev/hda4 2611 3916 10490445 8e Linux LVM

Command (M for help): W
The partition table has been altered!

Calling IOCTL () to re-read partition table.

Warning: re-reading the Partition Table failed with error 16: device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

(Note: We recommend that you restart the centos system)

[root @ localhost ~] # Pvcreate/dev/hda3
physical volume "/dev/hda4" successfully created
[root @ localhost ~] # Vgextend volgroup00/dev/hda3
volume group "volgroup00" successfully extended
[root @ localhost ~] # Lvextend-L + 100% free/dev/volgroup00/logvol00
extending logical volume logvol00 to 28.25 GB
logical volume logvol00 successfully resized
[root @ localhost ~] # Lvresize-L + 100% free/dev/volgroup00/logvol00
new size (904 extents) matches existing size (904 extents)
lvresize: resize a logical volume

Lvresize
[-A | -- autobackup y | n]
[-- Alloc allocationpolicy]
[-D | -- debug]
[-H | -- help]
[-I | -- stripes Stripes [-I | -- stripesize]
{-L |-extents [+ |-] logicalextentsnumber [% {VG | LV | free}] |
-L |-size [+ |-] logicalvolumesize [kkmmggttppee]}
[-N | -- nofsck]
[-R | -- resizefs]
[-T | -- Test]
[-- Type volumetype]
[-V | -- verbose]
[-- Version]
Logicalvolume [path] [physicalvolumepath...]

[Root @ localhost ~] # Resize2fs/dev/volgroup00/logvol00
Resize2fs 1.40.2 (12-jul-2007)
Filesystem at/dev/volgroup00/logvol00 is mounted on/; on-line resizing required
Old desc_blocks = 2, new_desc_blocks = 2
Ming an on-line resize of/dev/volgroup00/logvol00 to 7405568 (4 K) blocks.
The filesystem on/dev/volgroup00/logvol00 is now 7405568 blocks long.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.