FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 03-01-2010, 03:18 PM
"Styma, Robert E (Robert)"
 
Default Trying to convert a LVM partition to non-LVM

I was working on a linux box which had a failing disk over
the weekend. It still booted, but flagged smartd errors
and had a couple of damaged files which were fortunately
replaceable (eclipse install tgz).

I booted Spinrite to make the drive readable and then planned
to use system rescue CD and gparted to copy to an identical
drive. Unfortunately, the machine used the default boot
partition (ext3) and LVM for the root and swap partitions.
gpartd cannot currently deal with LVM partitions. This is
too bad as it is a great tool.

I initially tried laying out the partitions without LVM and
tar copying the root partition over. The /boot partition had
gone across with gpartd. I changed the grub.conf file and
the /etc/fstab file and even the /etc/mtab file. In each
case, the system would start to boot and then the kernel would
panic looking for the logical volumes.

In the end, I just laid out the partitions to match the original
drive and dd'ed both physical partitions to the new drive and it
worked.

My question becomes, "What file(s) other than fstab and grub.conf
need to change to change the root parttion from an LVM parition
to a normal ext partition such as sda2?"

I feel like I am close, but no cigar

Bob Styma
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 03-01-2010, 03:59 PM
"Styma, Robert E (Robert)"
 
Default Trying to convert a LVM partition to non-LVM

> Subject: Re: Trying to convert a LVM partition to non-LVM
>
> I've never gone from LVM to native disk, but are you sure you have
> copied your MBR to the new disk?
>
>
> On 1 March 2010 11:18, Styma, Robert E (Robert)
> <robert.styma@alcatel-lucent.com> wrote:
> > I was working on a linux box which had a failing disk over
> > the weekend. *It still booted, but flagged smartd errors
> > and had a couple of damaged files which were fortunately
> > replaceable (eclipse install tgz).
> >
> > I booted Spinrite to make the drive readable and then planned
> > to use system rescue CD and gparted to copy to an identical
> > drive. *Unfortunately, the machine used the default boot
> > partition (ext3) and LVM for the root and swap partitions.
> > gpartd cannot currently deal with LVM partitions. *This is
> > too bad as it is a great tool.
> >
> > I initially tried laying out the partitions without LVM and
> > tar copying the root partition over. *The /boot partition had
> > gone across with gpartd. *I changed the grub.conf file and
> > the /etc/fstab file and even the /etc/mtab file. *In each
> > case, the system would start to boot and then the kernel would
> > panic looking for the logical volumes.
> >
> > In the end, I just laid out the partitions to match the original
> > drive and dd'ed both physical partitions to the new drive and it
> > worked.
> >
> > My question becomes, "What file(s) other than fstab and grub.conf
> > need to change to change the root parttion from an LVM parition
> > to a normal ext partition such as sda2?"
> >
> > I feel like I am close, but no cigar
> >
> > Bob Styma

I forgot to mention that I used the grub command from system rescue CD
to fix up the mbr after I put the new drive in the machine by itself:

grub
...
root (hd0,0)
setup (hd0)


It is possible that I needed to also setup the partition boot record.
with
setup (hd0,0)
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 03-01-2010, 07:31 PM
Roberto Ragusa
 
Default Trying to convert a LVM partition to non-LVM

Styma, Robert E (Robert) wrote:
> My question becomes, "What file(s) other than fstab and grub.conf
> need to change to change the root parttion from an LVM parition
> to a normal ext partition such as sda2?"

Recreate the mkinitrd in your /boot.

Boot from a rescue disk, mount your system and chroot into that.
You can run mkinitrd manually (needs a filename /boot/initrd...
and the kernel version) or you can trigger the steps that happen
when you install a new kernel, by using a rpm -Uhv --oldpackage
kernel... or running the script the rpm would run
(rpm -q --scripts kernel prints something like
/sbin/new-kernel-pkg --package kernel --mkinitrd --depmod --install 2.6...
)

--
Roberto Ragusa mail at robertoragusa.it
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 03-01-2010, 09:32 PM
"Styma, Robert E (Robert)"
 
Default Trying to convert a LVM partition to non-LVM

>
> I do the g4l project, and it can make images of LVM
> partitions to new disks,
> but this is a raw mode image using dd. Depending on what
> errors the disk is
> having, you could make a backup image or clone it to a new
> disks. If the
> errors are to high, one might need to use ddrescue.
>
> I would first try to do an image to an ftp server, and see if
> that process works.
> Then restore to a new disk.
>
> There are versions of this on Sourceforge, but the latest
> version is at
>
> ftp://amd64gcc.dyndns.org/g4l-v0.33alpha18.iso
>
> Mostly newer linux kernels, and some updates.
>
Thank you for the suggestion. Actually, I was able to restore
the original functionality using the Spinrite program from grc.com
to get the disk errors out and then used dd to copy the raw LVM2 partition.

In cases where you are not using and not likely to use the neat
features of LVM, a simple partition is easier to work with.
It's just when I copied the internal ext3 file system in the
LVM Volgroup to a simple partition, I could not get it to boot.
Even after updating the grub device map, the grub.conf, the /etc/fstab,
and even the /etc/mtab, it would complain that it could not find
the volgroup and panic the kernel.

There must be some other control file I have not yet found which
would allow me to get the system to boot as a simple partition.

Bob
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 03-01-2010, 09:42 PM
"Styma, Robert E (Robert)"
 
Default Trying to convert a LVM partition to non-LVM

> Styma, Robert E (Robert) wrote:
> > My question becomes, "What file(s) other than fstab and grub.conf
> > need to change to change the root parttion from an LVM parition
> > to a normal ext partition such as sda2?"
>
> Recreate the mkinitrd in your /boot.
>
> Boot from a rescue disk, mount your system and chroot into that.
> You can run mkinitrd manually (needs a filename /boot/initrd...
> and the kernel version) or you can trigger the steps that happen
> when you install a new kernel, by using a rpm -Uhv --oldpackage
> kernel... or running the script the rpm would run
> (rpm -q --scripts kernel prints something like
> /sbin/new-kernel-pkg --package kernel --mkinitrd --depmod
> --install 2.6...
> )
>
> --
> Roberto Ragusa mail at robertoragusa.it

THANKS ROBERTO!
This looks like a winner. I will try this method on a test
machine shortly.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 03-02-2010, 10:34 PM
"Styma, Robert E (Robert)"
 
Default Trying to convert a LVM partition to non-LVM

> Subject: RE: Trying to convert a LVM partition to non-LVM
>
>
> > Styma, Robert E (Robert) wrote:
> > > My question becomes, "What file(s) other than fstab and grub.conf
> > > need to change to change the root parttion from an LVM parition
> > > to a normal ext partition such as sda2?"
> >
> > Recreate the mkinitrd in your /boot.
> >
> > Boot from a rescue disk, mount your system and chroot into that.
> > You can run mkinitrd manually (needs a filename /boot/initrd...
> > and the kernel version) or you can trigger the steps that happen
> > when you install a new kernel, by using a rpm -Uhv --oldpackage
> > kernel... or running the script the rpm would run
> > (rpm -q --scripts kernel prints something like
> > /sbin/new-kernel-pkg --package kernel --mkinitrd --depmod
> > --install 2.6...
> > )
> >
> > --
> > Roberto Ragusa mail at robertoragusa.it
>
> THANKS ROBERTO!
> This looks like a winner. I will try this method on a test
> machine shortly.
> --
Somewhat Solved,

After the partitions were copied over, I needed to get rid of the
references to the logical volume manager in serveral files:
/etc/fstab
/etc/mtab
/boot/grub/grub.conf

Then run:
mkinitrd /boot/initrd-2.6.18-53.el5.img 2.6.18-53.el5
Replace the version info by whatever kernel is loaded.

Then run grub and enter:
root (hd0,0)
setup (hd0)


I still go some funny udev errors, but the system came up.
There may be other files which need to be cleaned up that
I have not found yet, but at least the system came up.

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 06:55 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org