An odd one...

Mikkel L. Ellertson mikkel at infinity-ltd.com
Mon May 7 23:40:50 UTC 2007


Frode Petersen wrote:
> Mikkel L. Ellertson skrev:
>> Frode Petersen wrote:
>>> 1)
>>> I didn't change the kernel or the (memory?) image file, and I suspect
>>> that might be one reason. Are there hardcoded references to partitions
>>> in these files, so that the reference in grub.conf is used only to find
>>> the kernel, and not tell the kernel where to find and mount the other
>>> partitions? Has the kernel an 'image' of the disk system on which it is
>>> compiled?
>>>
>> The /boot/initrd-<version>.img file has information on the LVG
>> configuration, so if that is changing, you need to build a new
>> initrd file. man mkinitrd for more information.
> 
> Is that info related to names of partitions only, or to location on the
> disk also? I suspect the first, which would mean that I could use the
> tool you mention further down to move things around, ending up with an
> identical partitioning scheme even if I 'slide' the partitions over a
> bit on the physical disk. Or am I wrong?
> 
I never looked into it deep enough to see if the physical location
was stored in the initrd file, but I do not think it is. From what I
have read, I suspect that it would find the lvm volume even if the
partition number changed. This is what give peope problems when they
take a drive from another system, and add it to a working system. If
the volume group names are the same, the wrong one sometimes gets used.
>>
>> As a side note, you can use cp to copy a disk partition, but it is
>> not usually a good idea. This is especially true for a partition
>> mounted r/w. (I prefer using dd over cp when doing that type of
>> copy. Things like "dd if=/dev/fd0 of=floppy.img" can be handy.)
> 
> Is it safe to have both if and of point to a partition, or should I go
> with the intermediate image file?
> 
It is safe to if point to one partition, and of point to another
one. But the partitions should be the same size, because you are
doing a bit by bit copy, including the file system formatting. You
are coping the free space on the drive along with the data. So it is
not that good of a way to copy a hard drive unless you need an exact
copy for forensics or something along those lines.

>> If you want the learning experence, get the System Rescue CD. It can
>> handle LVM, but unless you copy /etc/lvm/lvm.conf to something like
>> a USB drive or floppy, you will have to use the lvm tools to
>> generate the information.
I see I forgot something - you also need the contents of the
/etc/lvm/archive or /etc/lvm/backup directory. This has the working
and back description of the lvm setup for you machine.
> 
> Thanks for the warning and the tip. I have fetched it and will try it out.
> 
> Thank you for the help with this. I had thought it was a lost cause, but
> I'll see what is to be learned from all this.
> 
> Frode
> 
Have fun. I have learned a lot about Linux doing things like that. I
have played with the SystemRescue CD on working systems so that when
I need to do it for real, it should be fairly easy. (As long as I
can remember what I did.)

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!




More information about the users mailing list