LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cloning drive but need advice (https://www.linuxquestions.org/questions/linux-newbie-8/cloning-drive-but-need-advice-591485/)

peterb 10-13-2007 07:41 AM

cloning drive but need advice
 
Hi all,

I have cloned my hdd 20gb to an 80gb drive using dd.
After testing to see if the cloning works, the system boots normally and from what I have seen my fedora appears to be working normally.

The problem that I am seeing is that my cloned drive is showing partitioned hda1 for boot and hda2 as linux LVM but not the full 80gb.

I had a look at the partitions through LVM and it shows Unintialized entities.

After doing an fdisk -l I see that /dev/hda2 ends at 2246 instead of 9964, and that the blocks are shown as 17936572+ instead of 61994835.
It also states that a disk /dev/dm-0 has an invalid partition table and shows /dev/dm-1 with 2013 MB and an invalid partition table.
Also, hda1 - boot is shown as linux ext3 type 83 whereas hda2 is shown as linux LVM type 8e.

I realize that the disk should be initialized but am not sure how to proceed. (Initialize first or simply extend by using fdisk to change parameters.)

Is it wise and normal to fdisk or cfdisk and change the drive spec and what should I change to be safe?

I also have QTParted installed as part of my previous system as well as LVM - logical volume management.

Peter

saikee 10-13-2007 08:02 AM

This is not going to be music to your ears!

You have achieved exactly what cloning is supposed to deliver; a mirror image of your original disk occupying exactly 20Gb, bootable and work exactly same as before. So move on and don't blame the cloning.

You next step is to use the unallocated empty space between the 21Gb to the 80th Gb in the hard disk.

You can do so by creating up to 15 partitions with the empty space. cfdisk and fdisk are OK for such task.

If you stick with the existing two partition arrangement you have to resize the partition boundary. That is a specialist's job.

Gaparted and Parted Magic, both available in Live CD, are the standard tools to resize Linux and PC hard disk partitions.

The bad news is, AFAIK, they do not support LVM, meaning they can resize a fat16/32, ntfs, ext2/3 reiserfs but not a LVM partition.

Don't use LVM myself. I suppose experts in LVM can give you advice what to do in your situation.

pixellany 10-13-2007 08:06 AM

When you clone in this way, the partition table is set up for a 20GB drive. Fixing it depends on what the partition layout is.

Please post the full output of "fdisk -l"

EDIT: Me type slow--Saikee is more knowledgeable on these things---also I missed that is was set up for LVM

peterb 10-13-2007 08:16 AM

Wow, I am surprised to see this info but I am positive that it will work out. I was thinking that it might just be a matter of initializing and then splicing the 2nd and 3rd parts together.

The output for fdisk is as follows:

[root@aurora ~]# fdisk -l

Disk /dev/hda: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 2246 17936572+ 8e Linux LVM

Disk /dev/dm-0: 8086 MB, 8086618112 bytes
255 heads, 63 sectors/track, 983 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 2013 MB, 2013265920 bytes
255 heads, 63 sectors/track, 244 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-1 doesn't contain a valid partition table

Disk /dev/sda: 131 MB, 131072000 bytes
5 heads, 50 sectors/track, 1024 cylinders
Units = cylinders of 250 * 512 = 128000 bytes

This doesn't look like a partition table
Probably you selected the wrong device.

Device Boot Start End Blocks Id System
/dev/sda1 ? 7679804 9857553 272218546+ 20 Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(356, 97, 46) logical=(7679803, 4, 9)
Partition 1 has different physical/logical endings:
phys=(357, 116, 40) logical=(9857552, 1, 1)
Partition 1 does not end on cylinder boundary.
/dev/sda2 ? 5320737 7476642 269488144 6b Unknown
Partition 2 has different physical/logical beginnings (non-Linux?):
phys=(288, 110, 57) logical=(5320736, 4, 3)
Partition 2 has different physical/logical endings:
phys=(269, 101, 57) logical=(7476641, 4, 40)
Partition 2 does not end on cylinder boundary.
/dev/sda3 ? 2155958 7749410 699181456 53 OnTrack DM6 Aux3
Partition 3 has different physical/logical beginnings (non-Linux?):
phys=(345, 32, 19) logical=(2155957, 2, 42)
Partition 3 has different physical/logical endings:
phys=(324, 77, 19) logical=(7749409, 1, 3)
Partition 3 does not end on cylinder boundary.
/dev/sda4 * 5578511 5578596 10668+ 49 Unknown
Partition 4 has different physical/logical beginnings (non-Linux?):
phys=(87, 1, 0) logical=(5578510, 3, 14)
Partition 4 has different physical/logical endings:
phys=(335, 78, 2) logical=(5578595, 4, 50)
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order
[root@aurora ~]#

By the way, there are no other o/s on this disk nor will there be.

Thanks for the help.
Peter

saikee 10-13-2007 08:29 AM

Quote:

Saikee is more knowledgeable on these things---also I missed that is was set up for LVM
Kind word from pixellany to a thicko who doesn't understand a LVM.

pixellany 10-13-2007 08:37 AM

OK--I'm afraid I'm a thicko too. (at least in re LVM)

I'm also lazy---I would simply backup important data and then do a clean install on the new disk. (and no LVM--I never install things that I dont understand)

peterb 10-13-2007 09:01 AM

Well, I have just finished searching for info in the forums here regarding LVM but didn't find much. Cloning and ghost lead to the fantastic thread on dd that I already had saved.

I would prefer not to have to do a new install and hope that someone may have tried to do something like this. My old drive is still working but I would prefer to go with the newer drive (again an ide), and I was contemplating moving to a sata but saw a few problems out there.

Hope that someone can provide some additional insight.

Peter

Junior Hacker 10-13-2007 01:12 PM

I'm a little pressed for time today, so did not read the link I post here, but this person shows how to reduce an LVM. Perhaps the steps can help you expand one. You can also look here.
I installed Fedora 7 in Windows under Vmware, it set up LVM also, but have not had the need to play with it.

peterb 10-15-2007 09:56 AM

Hi all,

I had a look at those links and found some useful info and so I decided to try a little experimentation.

Copied using dd 20gb to 80gb, then performed the following tests each time reloading the 80gb drive.

#1
system boots normally
fdisk -l shows mbr problem as well as not using full 80gb capacity

#2
boot using Fedora system rescue
fdisk /dev/hda
changed to advance
modified ending sector manually
saved and rebooted
system boots to grub

#3
system boots normally
using x-window I started LVM
LVM shows uninitialized partitions equaling the difference between the 20gb and the 80gb
initialized the partitions
merged using LVM to group00
rebooted
system boots to grub
attempted manually grub but cannot find filesystem files as outlined in
the grub trouble shooting guide
grub> root
(hd0,0): Filesystem type unknown, partition type 0x8e
it sees the LVM as unknown, the 8e is correct.

grub> find /boot/bzImage
Error 15: File not found
grub> find /boot/kernel
Error 15: File not found
grub> find /boot/vmlinuz
Error 15: File not found
grub> find /bzImage
Error 15: File not found
grub> find /kernel
Error 15: File not found
grub> find /vmlinuz
Error 15: File not found
setup (hd0)
Error 17: cannot mount selected partition

boot using Fedora system rescue
ls /etc displays file names
type /etc/fstab displays file not found
Conclusion is that LVM has corrupted the filesystem.

It looks like I will have to start a new install and then transfer my old files to the new system unless anyone sees something that I haven't tried.

[root@aurora ~]# fdisk -l

Disk /dev/hda: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 2246 17936572+ 8e Linux LVM
/dev/hda3 2247 9964 61994835 8e Linux LVM

from the expert command
Disk /dev/hda: 255 heads, 63 sectors, 9964 cylinders

Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID
1 80 1 1 0 254 63 12 63 208782 83
2 00 0 1 13 254 63 1023 208845 35873145 8e
3 00 0 1 1023 254 63 1023 36081990 123989670 8e
4 00 0 0 0 0 0 0 0 0 00

Disk /dev/dm-0: 8086 MB, 8086618112 bytes
255 heads, 63 sectors/track, 983 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 2013 MB, 2013265920 bytes
255 heads, 63 sectors/track, 244 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-1 doesn't contain a valid partition table

Anyway, after trying out the above and a few other ideas, I finally gave up and simply installed a fresh copy on the new 80gb drive.

I guess that this is just one of those things for the wishlist for the future.

Peter
:twocents:

saikee 10-15-2007 10:37 AM

There is something wrong in your approach if you can't find the kernel "vmlinuz" or "bzImage".

I say this because no Linux boot loader can read a LVM and so to boot a Linux with a LVM the kernel must be placed in a /boot partition which is what your /dev/hda1 is all about.

You therefore has no requirement to alter the boundary of hda1 and the kernels inside are untouched and should always accessible.

For a fresh installation you could have done so by installing it in the newly created partitions hda3 (for Linxu) and hda4 (for swap). That way you can go back to fetch all your previous data in the LVM and copy them on to the new partition.

If you opt out the LVM you can install the Linux in a single partition with /boot as a subdirectory to "/".

AwesomeMachine 10-15-2007 01:09 PM

This is ridiculous. Just partition the free space and format it. Don't use LVM, though. LVM is partition voodoo, and I don't know anyone who understands it, anyone who uses it, or any tools that work with it. I think it should be mandatory, in every distro, that the user do a custom partition setup, so they can avoid LVM.

farslayer 10-15-2007 01:18 PM

LVM how-to expand partitions..
http://www.linuxhomenetworking.com/w..._Disk_Capacity

I dunno after looking at that it looks easier to use gparted to expand normal partitions.. I thought LVM was supposed to make this easier ?


All times are GMT -5. The time now is 08:20 AM.