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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-13-2007, 07:41 AM
|
#1
|
Member
Registered: Aug 2003
Location: Athens, Greece
Distribution: Synology, Debian, Fedora, Raspberry Pi 4b, Arduino UNO R3
Posts: 136
Rep:
|
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 07:45 AM.
|
|
|
10-13-2007, 08:02 AM
|
#2
|
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Rep: 
|
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.
|
|
|
10-13-2007, 08:06 AM
|
#3
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
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 08:10 AM.
|
|
|
10-13-2007, 08:16 AM
|
#4
|
Member
Registered: Aug 2003
Location: Athens, Greece
Distribution: Synology, Debian, Fedora, Raspberry Pi 4b, Arduino UNO R3
Posts: 136
Original Poster
Rep:
|
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 08:37 AM.
|
|
|
10-13-2007, 08:29 AM
|
#5
|
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Rep: 
|
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.
|
|
|
10-13-2007, 08:37 AM
|
#6
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
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)
|
|
|
10-13-2007, 09:01 AM
|
#7
|
Member
Registered: Aug 2003
Location: Athens, Greece
Distribution: Synology, Debian, Fedora, Raspberry Pi 4b, Arduino UNO R3
Posts: 136
Original Poster
Rep:
|
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
|
|
|
10-13-2007, 01:12 PM
|
#8
|
Senior Member
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687
Rep:
|
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.
|
|
|
10-15-2007, 09:56 AM
|
#9
|
Member
Registered: Aug 2003
Location: Athens, Greece
Distribution: Synology, Debian, Fedora, Raspberry Pi 4b, Arduino UNO R3
Posts: 136
Original Poster
Rep:
|
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

|
|
|
10-15-2007, 10:37 AM
|
#10
|
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Rep: 
|
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 "/".
|
|
|
10-15-2007, 01:09 PM
|
#11
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
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.
|
|
|
10-15-2007, 01:18 PM
|
#12
|
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Rep: 
|
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:28 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|