LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 10-13-2007, 08:41 AM   #1
peterb
Member
 
Registered: Aug 2003
Location: Athens, Greece
Distribution: Mandriva, Fedora
Posts: 127

Rep: Reputation: 15
Question 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

Last edited by peterb; 10-13-2007 at 08:45 AM.
 
Old 10-13-2007, 09:02 AM   #2
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
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.
 
Old 10-13-2007, 09:06 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
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

Last edited by pixellany; 10-13-2007 at 09:10 AM.
 
Old 10-13-2007, 09:16 AM   #4
peterb
Member
 
Registered: Aug 2003
Location: Athens, Greece
Distribution: Mandriva, Fedora
Posts: 127

Original Poster
Rep: Reputation: 15
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

Last edited by peterb; 10-13-2007 at 09:37 AM.
 
Old 10-13-2007, 09:29 AM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
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.
 
Old 10-13-2007, 09:37 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
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)
 
Old 10-13-2007, 10:01 AM   #7
peterb
Member
 
Registered: Aug 2003
Location: Athens, Greece
Distribution: Mandriva, Fedora
Posts: 127

Original Poster
Rep: Reputation: 15
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
 
Old 10-13-2007, 02:12 PM   #8
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
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.
 
Old 10-15-2007, 10:56 AM   #9
peterb
Member
 
Registered: Aug 2003
Location: Athens, Greece
Distribution: Mandriva, Fedora
Posts: 127

Original Poster
Rep: Reputation: 15
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
 
Old 10-15-2007, 11:37 AM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
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 "/".
 
Old 10-15-2007, 02:09 PM   #11
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian jessie/sid; OpenSuSE; Fedora
Posts: 1,593

Rep: Reputation: 162Reputation: 162
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.
 
Old 10-15-2007, 02:18 PM   #12
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
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 ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cloning a sata drive bicolano53 Linux - Hardware 4 04-18-2007 09:00 AM
Cloning onto drive that already has data tredontho Linux - General 5 07-26-2006 05:17 AM
Need help in cloning drive raddad51x Fedora 1 05-16-2006 02:31 AM
Cloning a hard drive davcefai Debian 3 11-28-2005 06:36 PM
Cloning Hard Drive rls Linux - Software 3 08-23-2003 03:32 PM


All times are GMT -5. The time now is 05:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration