Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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-09-2008, 02:25 PM
|
#16
|
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,152
|
Hmmm.
1] I'm clutching at straws here, and again, no offence intended, but are you remembering to "w write table to disk and exit"?
2] Maybe you should check your BIOS (I don't know how old it is). There are options sometimes for LBA (IIRC) and whatnot addressing of disks. It is worth a thorough look. Modern BIOSs don't care about the real, physical number of heads, cylinders, etc, older ones did. Check your BIOS, try different settings.
3] If you have access to them, do other PCs make any more sense of its geometry?
.
4] How old is this disk? What make / model is it?
Of course there is always the possibility that the disk (or, more likely, its (IDE ?) interface) is broken
Last edited by tredegar; 10-10-2008 at 12:07 PM.
Reason: "LBA" not "LVM"
|
|
|
10-10-2008, 02:04 AM
|
#17
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Rep:
|
Do you have a second disk of the same type, which you might copy over to the "mangled" one by dd?
<edit> ... or of any type, to test whether that behavior is reproducible ...
And again:
http://www.linuxquestions.org/questi...br#post2224998
and the main thread searched for "MBR"
http://www.linuxquestions.org/questi...archid=2773506
</edit>
Last edited by JZL240I-U; 10-10-2008 at 02:12 AM.
|
|
|
10-10-2008, 02:41 AM
|
#18
|
Senior Member
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Rep:
|
Quote:
Originally Posted by DeadlyMuffin
I copied an entire disk to a larger one using:
dd if=/dev/source of=image
dd if=image of=/dev/target
The source drive was 40gigs, the target drive 110gigs. Everything seems to have worked, but now the drive geometry on the target drive reads the same as the source drive. Is there any way to recover the unused space?
|
There is software named "TestDisk". I used it once to restore accidentally erased MBR, but it might be able to fix drive geometry as well.
|
|
|
11-21-2008, 12:35 PM
|
#19
|
LQ Newbie
Registered: Nov 2008
Posts: 8
Rep:
|
I have the exact same problem... Did you eventually find out how to fix this ?
Note: i tried testdisk, you can tune the geometry, but only to find new partitions as it seems.
Last edited by julienV; 11-21-2008 at 01:01 PM.
|
|
|
11-21-2008, 01:03 PM
|
#20
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
I'm coming in late and the water may be under the bridge, but one thing caught my eye:
To the best of my knowledge, the partition table only describes the size, location and type of the partitions. I did not think the actual parameters of the drive would be affected by dd. This said, it is true that cloning partitions is much better than cloning whole drives.
Does anyone know for sure where the basic drive info is stored and whether dd will affect it? (I'm resisting the urge to haul the old P3 off the top shelf and run tests.....)
|
|
|
11-21-2008, 01:42 PM
|
#21
|
LQ Newbie
Registered: Nov 2008
Posts: 8
Rep:
|
the weird thing is that i tried to copy the boot sector of a bigger disk with the same method i used to screw up the first time, and this time, the size is still the size of the smaller disk.
In fact, the only parameter i would have to change is the number of cylinders.
In the bios, the size of the disk is now wrong too (50 instead of 160)...
|
|
|
11-21-2008, 03:05 PM
|
#22
|
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,152
|
Quote:
In the BIOS, the size of the disk is now wrong too (50 instead of 160)...
|
The BIOS is reading the disk geometry from the disk. The disk is reporting the geometry incorrectly, because you have used dd without fully understanding what it does, and the implications.
If it is all in a big mess (it seems it is), and there are "inconsistencies" (it seems there are) then the best thing to do is go back to basics before you make the situation even worse:
My recommendation:
1] Rescue your files:
Become the root user. Then:
Code:
cd /path/to/directory/to/be/rescued
tar cf - . | (cd /path/to/rescue/directory/on/another/disk && tar xBfp -)
(It's a "tar pipe", don't ask me how it works, but it has always copied and preserved everything for me)
2] fdisk and repartition your badly-behaving drive
3] Format your badly-behaving drive with the filesystem of your choice ( ext3 for me).
4] Restore your files:
Code:
cd /path/to/rescue/directory/on/another/disk
tar cf - . | (cd /path/to/your/reformatted/disk && tar xBfp -)
5] Check that you can access your files on /path/to/your/reformatted/disk
6] exit from being the root user
7] You are done.
In future, please open a new thread for this type of question
|
|
|
11-21-2008, 04:26 PM
|
#23
|
LQ Newbie
Registered: Nov 2008
Posts: 8
Rep:
|
Hi tredegar,
thanks for replying an trying !
First, let me say i didn't open a new thread, because the situation described in the first post is exactly the same as mine, and it doesn't seem to have been solved.
Now, regarding fdisk, it doesn't do much. Yes, I can format and partition the disk... but as a 58.5 GB disk instead of 160 GB:
Code:
Disk /dev/sdb: 58.5 GB, 58506416640 bytes
255 heads, 63 sectors/track, 7113 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0008018f
Device Boot Start End Blocks Id System
/dev/sdb1 1 7113 57135141 83 Linux
I tried to go to expert mode (x), change number of cylinder (19457, which is the proper number for the disk, samsung HM160HI), and create a partition going from cylinder 1 to 19457. But it doesn't work:
Quote:
Total allocated sectors 312576643 greater than the maximum 114270345
|
(of course...)
|
|
|
11-21-2008, 05:07 PM
|
#24
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,285
|
Gawd I wish people would leave "dd" alone.
Use the grub "geometry" subcommand to reset the number of (physical) cylinders, then fdisk might be more accommodating.
|
|
|
11-21-2008, 08:00 PM
|
#25
|
LQ Newbie
Registered: Nov 2008
Posts: 8
Rep:
|
well, i promise I won't touch dd ever again... I usually use partimage and ntfsclone for that job, but i wanted to try a different method...
Anyway, I'm trying to change the geometry at boot time in grub:
- enter grub (c)
- geometry (hd2) 19457 255 63) => it always indicate 1024 cylinders for each disk.
- configfile (hd0,0)/boot/grub/menu.lst
=> no change once system is running, still 7113 cylinders
If i run grub during my session, the geometry command properly displays the number of cylinders for each disk, and i can set hd2 to 19457. But then, how do i exit from grub shell to impact my running session ?
|
|
|
11-21-2008, 08:40 PM
|
#26
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,285
|
quit, then reboot would be simplest.
|
|
|
11-22-2008, 05:42 AM
|
#27
|
LQ Newbie
Registered: Nov 2008
Posts: 8
Rep:
|
from my ubuntu session, i did in the grub shell:
- geometry (hd2) 19457 255 63 => it reports the disk size as 160 GB
- quit
and rebooted the computer => no change, next session, fdisk -l still give me the wrong number of cyl
tried to put the "geometry" line in the menu.lst (maybe that is stupid...) => no change
Sorry...
|
|
|
11-24-2008, 06:26 PM
|
#28
|
LQ Newbie
Registered: Nov 2008
Posts: 8
Rep:
|
well... no more ideas ? I'm not complaining, don't take it wrong, it put myself in this situation
|
|
|
11-24-2008, 07:09 PM
|
#29
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,285
|
Not really - I would have expected that to work, but I don't have a disk I'm prepared to try on.
The various [cs]fdisk variants might be worth a try - seems you have nothing (more) to lose.
|
|
|
12-01-2008, 05:07 PM
|
#30
|
LQ Newbie
Registered: Nov 2008
Posts: 8
Rep:
|
update: SOLVED !
this post had the solution: http://www.linuxquestions.org/questi...ing-dd-632886/
I was indeed upgrading the disk for a dell laptop, and my problems started the first time i put the new drive in the dell => during the boot, the dell bios rewrote the LBA-3 so that i had a hidden partition of 100 gigas... As said in the post, using HDAT2 allowed me to remove the hidden partition and get the disk right.
it's interesting that none the tools i used saw the hidden partition, but i guess that is the point !
|
|
|
All times are GMT -5. The time now is 03:12 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
|
|