Discussion:
problem using parted on partition containing a logical volume
Bill Tangren
18 years ago
Permalink
[I posted this question on the nahant list, as part of a larger question.]


I have been attempting to reduce the size of the root partition on a default
install of RHEL ES 4, and I have not been entirely successful so far. The volume
group contains two logical volumes / (LogVol00) and swap (LogVol01).

What I've done is:

1) Booted into rescue mode, not mounting the disk partitions.

2) Issued these commands:

# lvm vgchange -a y
# e2fsck -f /dev/VolGroup00/LogVol00
# resize2fs /dev/VolGroup00/LogVol00 4G
# lvm lvreduce -L 4G /dev/VolGroup00/LogVol00
# lvm pvresize --setphysicalvolumesize 4.5G /dev/hda2
# lvm lvremove /dev/VolGroup00/LogVol01
# lvm pvresize --setphysicalvolumesize 4.6G /dev/hda2
# lvm lvcreate -L 512M -n LogVol01 /dev/VolGroup00

All this has been successful. However, the problem I have now is with parted:

# parted /dev/hda
(parted) print
Minor Start End Type Filesystem Flags
1 0.031 101.975 primary ext3 boot
2 101.975 19069.343 primary lvm
(parted) check 2
Error: Could not detect file system.
(parted) resize 2 101.975 4813
Error: Could not detect file system.
(parted) print
Minor Start End Type Filesystem Flags
1 0.031 101.975 primary ext3 boot
2 101.975 19069.343 primary lvm
(parted)

parted won't change the partition.

Why? What am I doing wrong?

Any thoughts?

Bill Tangren
--
redhat-list mailing list
unsubscribe mailto:redhat-list-***@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
BERES Laszlo
18 years ago
Permalink
Post by Bill Tangren
parted won't change the partition.
Why? What am I doing wrong?
Did you read this doc?

http://www.gnu.org/software/parted/manual/html_chapter/parted_7.html
--
BÉRES László RHCE, RHCX
senior IT engineer, trainer
--
redhat-list mailing list
unsubscribe mailto:redhat-list-***@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
Bill Tangren
18 years ago
Permalink
Post by BERES Laszlo
Post by Bill Tangren
parted won't change the partition.
Why? What am I doing wrong?
Did you read this doc?
http://www.gnu.org/software/parted/manual/html_chapter/parted_7.html
That is what I needed. Thanks!
--
redhat-list mailing list
unsubscribe mailto:redhat-list-***@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
Bill Tangren
18 years ago
Permalink
Post by BERES Laszlo
Post by Bill Tangren
parted won't change the partition.
Why? What am I doing wrong?
Did you read this doc?
http://www.gnu.org/software/parted/manual/html_chapter/parted_7.html
This document states that one should reduce the size of the partition first,
before reducing the size of the logical volume group. So, I reinstalled the OS,
repartitioning along the way, so that I can try with a clean slate.

When I run parted, I get the same problems:

# parted /dev/hda
Using /dev/hda

(parted) check 1
Error: Filesystem has incompatible feature enabled

(parted) check 2
Error: Could not detect filesystem.

(parted) print 2
Error: Could not detect filesystem.

(parted) print
Disk geometry for /dev/hda: 0.000-19073.486 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 0.031 101.975 primary ext3 boot
2 101.975 19069.343 primary lvm

(parted) resize 2 101.975 4813
Error: Could not detect file system.

This is BEFORE I reduced the logical volumes.

This:

http://hypodermia.blogspot.com/2005/08/in-case-this-ever-happens-to-you.html

indicates that it is not possible to resize the partition as it is, because of
incompatible features in the filesystem that make it incompatible with parted
and partition magic. The fix listed there seems to leave the filesystem without
the ability to use SELinux, which I find unacceptable.

This

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=90894

indicates that this is a bug in parted, which will be fixed in the 2.0 release.
It indicates that:

"Currently the _only_ tool that can resize ext3 filesystems is resize2fs
available in e2fsprogs. While annoying, you can use resize2fs to resize the
filesystem and then use fdisk or parted to resize the partition boundary to
match the new filesystem size. With parted 2.0, we'll be able to do this in one
step."

I'll try resize2fs on this toy system, and see how it is done.

Bill
--
redhat-list mailing list
unsubscribe mailto:redhat-list-***@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
Continue reading on narkive:
Loading...