LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 10-09-2008, 01:25 PM   #16
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435

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 11:07 AM. Reason: "LBA" not "LVM"
 
Old 10-10-2008, 01:04 AM   #17
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
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 01:12 AM.
 
Old 10-10-2008, 01:41 AM   #18
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by DeadlyMuffin View Post
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.
 
Old 11-21-2008, 11:35 AM   #19
julienV
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 0
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 12:01 PM.
 
Old 11-21-2008, 12:03 PM   #20
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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.....)
 
Old 11-21-2008, 12:42 PM   #21
julienV
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 0
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)...
 
Old 11-21-2008, 02:05 PM   #22
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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
 
Old 11-21-2008, 03:26 PM   #23
julienV
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 0
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...)
 
Old 11-21-2008, 04:07 PM   #24
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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.
 
Old 11-21-2008, 07:00 PM   #25
julienV
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 0
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 ?
 
Old 11-21-2008, 07:40 PM   #26
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
quit, then reboot would be simplest.
 
Old 11-22-2008, 04:42 AM   #27
julienV
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 0
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...
 
Old 11-24-2008, 05:26 PM   #28
julienV
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 0
well... no more ideas ? I'm not complaining, don't take it wrong, it put myself in this situation
 
Old 11-24-2008, 06:09 PM   #29
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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.
 
Old 12-01-2008, 04:07 PM   #30
julienV
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 0
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 !
 
  


Reply



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
Drive Geometry Problems jcmalc Debian 1 09-23-2005 02:13 AM
Hard drive geometry possibly borked, weird random errors. purplecow Linux - Hardware 2 06-15-2005 01:11 PM
Debian Sarge netinst & businesscard, grub, changes drive geometry...Y? Outabux Debian 1 10-20-2004 10:57 PM
manually entering drive geometry artofluke Slackware 1 12-08-2003 02:06 AM
drive geometry problems artofluke Linux - Hardware 1 11-22-2003 03:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:59 AM.

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
Open Source Consulting | Domain Registration