LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-30-2014, 01:32 PM   #16
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600

Quote:
Originally Posted by geofyt View Post
I had backups. My backup device broke yesterday.
Nothing to fear but fear itself, eh? ;-p


Quote:
Originally Posted by geofyt View Post
Code:
Disk /dev/sda - 160 GB / 149 GiB - CHS 19457 255 63
Current partition structure:
     Partition                  Start        End    Size in sectors

Warning: number of heads/cylinder mismatches 65 (NTFS) != 255 (HD)
Warning: number of sectors per track mismatches 26 (NTFS) != 63 (HD)
What does this return:
Code:
hdparm -iI /dev/sda
*Any particular BIOS mucking you did BTW?
 
Old 12-30-2014, 05:25 PM   #17
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by unSpawn View Post
*Any particular BIOS mucking you did BTW?
I think this may be more to the point; I get the impression that this machine has not been used for a while, the backup battery for the BIOS settings may be low/dead, and the BIOS settings may have been corrupted/restored to default values. Is any of that plausible?
 
Old 12-31-2014, 08:25 AM   #18
geofyt
LQ Newbie
 
Registered: Dec 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Code:
#hdparm -iI /dev/sda

/dev/sda:

 Model=SAMSUNG HD160JJ, FwRev=ZM100-33, SerialNo=S08HJ10Y968343
 Config={ Fixed }
 RawCHS=16383/16/63, TrkSize=34902, SectSize=554, ECCbytes=4
 BuffType=DualPortCache, BuffSize=8192kB, MaxMultSect=16, MultSect=16
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=312581808
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4 
 DMA modes:  mdma0 mdma1 mdma2 
 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
 AdvancedPM=no WriteCache=enabled
 Drive conforms to: unknown:  ATA/ATAPI-1,2,3,4,5,6,7

 * signifies the current active mode


ATA device, with non-removable media
	Model Number:       SAMSUNG HD160JJ                         
	Serial Number:      S08HJ10Y968343      
	Firmware Revision:  ZM100-33
Standards:
	Used: ATA/ATAPI-7 T13 1532D revision 4a 
	Supported: 7 6 5 4 & some of 8
Configuration:
	Logical		max	current
	cylinders	16383	16383
	heads		16	16
	sectors/track	63	63
	--
	CHS current addressable sectors:   16514064
	LBA    user addressable sectors:  268435455
	LBA48  user addressable sectors:  312581808
	Logical/Physical Sector size:           512 bytes
	device size with M = 1024*1024:      152627 MBytes
	device size with M = 1000*1000:      160041 MBytes (160 GB)
	cache/buffer size  = 8192 KBytes (type=DualPortCache)
Capabilities:
	LBA, IORDY(can be disabled)
	Queue depth: 32
	Standby timer values: spec'd by Standard, no device specific minimum
	R/W multiple sector transfer: Max = 16	Current = 16
	Recommended acoustic management value: 254, current value: 0
	DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 udma7 
	     Cycle time: min=120ns recommended=120ns
	PIO: pio0 pio1 pio2 pio3 pio4 
	     Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
	Enabled	Supported:
	   *	SMART feature set
	    	Security Mode feature set
	   *	Power Management feature set
	   *	Write cache
	   *	Look-ahead
	   *	Host Protected Area feature set
	   *	WRITE_BUFFER command
	   *	READ_BUFFER command
	   *	NOP cmd
	   *	DOWNLOAD_MICROCODE
	    	SET_MAX security extension
	    	Automatic Acoustic Management feature set
	   *	48-bit Address feature set
	   *	Device Configuration Overlay feature set
	   *	Mandatory FLUSH_CACHE
	   *	FLUSH_CACHE_EXT
	   *	SMART error logging
	   *	SMART self-test
	   *	General Purpose Logging feature set
	   *	Gen1 signaling speed (1.5Gb/s)
	   *	Gen2 signaling speed (3.0Gb/s)
	   *	Native Command Queueing (NCQ)
	   *	Host-initiated interface power management
	   *	Phy event counters
	   *	DMA Setup Auto-Activate optimization
	    	Device-initiated interface power management
	   *	Software settings preservation
	   *	SMART Command Transport (SCT) feature set
	   *	SCT Read/Write Long (AC1), obsolete
	   *	SCT Write Same (AC2)
	   *	SCT Error Recovery Control (AC3)
	   *	SCT Features Control (AC4)
	   *	SCT Data Tables (AC5)
Security: 
	Master password revision code = 65534
		supported
	not	enabled
	not	locked
		frozen
	not	expired: security count
		supported: enhanced erase
	120min for SECURITY ERASE UNIT. 120min for ENHANCED SECURITY ERASE UNIT. 
Checksum: correct

Quote:
Any particular BIOS mucking you did BTW?
Quote:
I think this may be more to the point; I get the impression that this machine has not been used for a while, the backup battery for the BIOS settings may be low/dead, and the BIOS settings may have been corrupted/restored to default values. Is any of that plausible?
I haven't been tinkering with the BIOS, and I did use my computer on a regularly irregular base, but not those partitions. Because I had a backup, I didnt feel rushed to hook those up in my current setup.

I just recalled this: About a month ago, I booted to my Windows partition. I got error messages concerning the partitions of the hard disk. There were plenty and quite indeipherable to me. I rebooted to Linux and never paid attention to them. Perhaps it was then when this failure happened. Because I never had seen errors while using or booting Linux , I just regarded them as plain Windows error messages and did nothing after. Bit thick perhaps.
 
Old 12-31-2014, 10:21 AM   #19
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by geofyt View Post
Code:
 RawCHS=16383/16/63
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=312581808
Set 16383 cylinders, 16 heads and 63 sectors in testdisk and try again?


Quote:
Originally Posted by geofyt View Post
I just recalled this: About a month ago, I booted to my Windows partition. I got error messages concerning the partitions of the hard disk. There were plenty and quite indeipherable to me. I rebooted to Linux and never paid attention to them.
(Not that I am the slightest interested in looking at it but) Windows does have system logs. So any errors will be recorded there. Maybe have a look?
 
Old 12-31-2014, 01:11 PM   #20
geofyt
LQ Newbie
 
Registered: Dec 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Set 16383 cylinders, 16 heads and 63 sectors in testdisk and try again?
I'm currently not able to. But tomorrow, I will. Perhaps a new year will bring luck

Quote:
(Not that I am the slightest interested in looking at it but) Windows does have system logs. So any errors will be recorded there. Maybe have a look?
It seems those logs are accessed through an event manager, which requires me to boot into Windows to run a program to look at the files... I'm a bit hesitant to do so, because I suspect Windows did something to my disk. No solid proof of that though.

In the meanwhile thanks for sticking around
 
Old 12-31-2014, 02:33 PM   #21
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Oh well, that's OK. Let's procrastinate until next year ;-p
 
Old 01-02-2015, 05:03 AM   #22
geofyt
LQ Newbie
 
Registered: Dec 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Oh well, that's OK. Let's procrastinate until next year ;-p
Yeah, I have got to work on that. This would make a good New Years resolution for 2016.

Quote:
Set 16383 cylinders, 16 heads and 63 sectors in testdisk and try again?
Code:
Disk /dev/sda - 8455 MB / 8063 MiB - CHS 16383 16 63
This makes testdisk think I have a 8455MB hard drive. For every partition Testdisk also warns about "Bad starting head (CHS and LBA don't match)"


I realized I have a similar hard drive laying around. I scooped it up, and connected it to see what the CHS data was. The drive is a Samsung SP1614C which has the same numbers of bytes and sectors as the HD160JJ we are trying to fix. SP1614C has 19457 cylinders, 255 heads and 63 sectors. These values are also used in Testdisk's analyze option.

Furthermore I tried the program to see what it could do, but honestly, I dont really get it. Despite consulting the wiki.

Lastly, I knew I had a print of results from fdisk -l from a few years ago. I found it, but apparently fdisk didn't include CHS data some time ago. (Different partition layout was used as well)

Last edited by geofyt; 01-02-2015 at 05:16 AM.
 
Old 01-02-2015, 05:39 AM   #23
geofyt
LQ Newbie
 
Registered: Dec 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
In analyze I eventually get:

Code:
 1 * HPFS - NTFS              0  32 33  9728 203 11  156291072
 2 P HPFS - NTFS           9728 203 12 12322 237 11   41674752 [Documenten]
 3 P Linux                12322 237 12 14917  16 11   41674752
 4 E extended LBA         14917  16 12 19457  53 52   72937472
 5 L Linux                14917  48 44 17511  82 43   41674752
 6 L Linux Swap           17511 115 13 17835 195 24    5210112
 7 L Linux                17835 227 57 19457  21 20   26044416
This looks correct to me. I feel rather silly to ask, but can I write this partition table to disk? Safely without compromising data on /dev/sda5 and /dev/sda7...?
 
Old 01-02-2015, 06:01 AM   #24
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by geofyt View Post
I feel rather silly to ask, but can I write this partition table to disk? Safely without compromising data on /dev/sda5 and /dev/sda7...?
Yes you can as the data in the Partition Table is just one location at the start of the disk, changing it doesn't change partition data.
Making a backup of the PT to file never hurts:
Code:
dd if=/dev/sda of=/var/tmp/pt.dd bs=1 skip=446 count=64
(...or the whole MBR if you feel like it:
Code:
dd if=/dev/sda of=/var/tmp/mbr.dd bs=1 count=512
) then verify the result:
Code:
dd if=/dev/sda bs=1 skip=446 count=64|md5sum
md5sum of=/var/tmp/pt.dd
If both hashes are the same then let Testdisk write the PT based on your analysis results.

Should you wish to restore the PT simply reverse of and if:
Code:
dd if=/var/tmp/partitiontable.dd of=/dev/sda bs=1 skip=446 count=64
then you can test the result same way.
 
Old 01-02-2015, 12:34 PM   #25
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by unSpawn View Post
Yes you can as the data in the Partition Table is just one location at the start of the disk, changing it doesn't change partition data.
Caution: There is an extended partition with logical drives. Each of those logical drives will get a sector with an extended partition table written at the start of it. If those logical drives are not in the correct position, you will be overwriting some of your data. It is only the primary partition table that can be casually overwritten without fear of hurting your data.

There would be no such concern with GPT, but this drive is not using GPT.
 
1 members found this post helpful.
Old 01-02-2015, 01:29 PM   #26
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by rknichols View Post
Caution: There is an extended partition with logical drives. Each of those logical drives will get a sector with an extended partition table written at the start of it. If those logical drives are not in the correct position, you will be overwriting some of your data. It is only the primary partition table that can be casually overwritten without fear of hurting your data.
Thanks for clarifying, I learned something new there.
 
Old 01-04-2015, 11:58 AM   #27
geofyt
LQ Newbie
 
Registered: Dec 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Writing this partition table didn't help:
Code:
 1 * HPFS - NTFS              0  32 33  9728 203 11  156291072
 2 P HPFS - NTFS           9728 203 12 12322 237 11   41674752 [Documenten]
 3 P Linux                12322 237 12 14917  16 11   41674752
 4 E extended LBA         14917  16 12 19457  53 52   72937472
 5 L Linux                14917  48 44 17511  82 43   41674752
 6 L Linux Swap           17511 115 13 17835 195 24    5210112
 7 L Linux                17835 227 57 19457  21 20   26044416
After rebooting the results of Testdisk disk analysis:
Code:
Disk /dev/sda - 160 GB / 149 GiB - CHS 19457 255 63
Current partition structure:
     Partition                  Start        End    Size in sectors

Warning: number of heads/cylinder mismatches 65 (NTFS) != 255 (HD)
Warning: number of sectors per track mismatches 26 (NTFS) != 63 (HD)
 1 * HPFS - NTFS              0  32 33  9728 203 11  156291072
Warning: number of heads/cylinder mismatches 65 (NTFS) != 255 (HD)
Warning: number of sectors per track mismatches 26 (NTFS) != 63 (HD)
 2 P HPFS - NTFS           9728 203 12 12322 237 11   41674752 [Documenten]
 3 P Linux                12322 237 12 14917  16 11   41674752
 4 E extended LBA         14917  16 12 19457  53 52   72937472
No ext2, JFS, Reiser, cramfs or XFS marker
 5 L Linux                14917  48 44 17511  82 43   41674752
 5 L Linux                14917  48 44 17511  82 43   41674752
   X extended             17511 114  1 17835 195 24    5210187
 6 L Linux Swap           17511 115 13 17835 195 24    5210112
 6 L Linux Swap           17511 115 13 17835 195 24    5210112
   X extended             17835 226  1 19457  21 20   26044535
No ext2, JFS, Reiser, cramfs or XFS marker
 7 L Linux                17835 227 57 19457  21 20   26044416
 7 L Linux                17835 227 57 19457  21 20   26044416
A deeper search, searching partition cylinder by cylinder, starting at the end of the correct Linux partition:
Code:
Disk /dev/sda - 160 GB / 149 GiB - CHS 19457 255 63
     Partition               Start        End    Size in sectors
>  HPFS - NTFS              0  32 33  9728 203 11  156291072
   HPFS - NTFS              0  32 33 15012  74 38  241170432
   HPFS - NTFS           9728 203 12 12322 237 11   41674752 [Documenten]
   Linux                12322 237 12 14917  16 11   41674752
 * FAT16 >32M           17511 115 13 17835 195 24    5210112
 P FAT16 >32M           17835 227 57 19457  21 20   26044416
I'm now doing a cylinder analysis for the complete disk. I have no hopes for that, but it never hurts.
 
Old 01-04-2015, 03:44 PM   #28
geofyt
LQ Newbie
 
Registered: Dec 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
I'm now doing a cylinder analysis for the complete disk. I have no hopes for that, but it never hurts.
After a full analysis, Testdisk suggested trying 140 cylinders. This won't be it, so here no luck either.

In other tries I tested to check for Reiser superblocks. Nothing. In the end I let loose photorec to see what it could harvest from both disks. There were files found, but alas, not the ones useful. Seems to me, this is a hopeless case. Right?
 
Old 01-04-2015, 09:48 PM   #29
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
My last-ditch strategy with testdisk is to set Partition Type to "None" at the start, then go into the Geometry menu and change both Heads and Sectors to 1, letting testdisk recalculate "Cylinders" as the total number of sectors on the disk. Sometimes that's the only way to get it to ignore space that it sees as properly allocated and to check every sector, not just the ones that it thinks are in "likely" locations.
 
Old 01-05-2015, 04:36 AM   #30
geofyt
LQ Newbie
 
Registered: Dec 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
My last-ditch strategy with testdisk is to set Partition Type to "None" at the start, then go into the Geometry menu and change both Heads and Sectors to 1, letting testdisk recalculate "Cylinders" as the total number of sectors on the disk. Sometimes that's the only way to get it to ignore space that it sees as properly allocated and to check every sector, not just the ones that it thinks are in "likely" locations.
Too bad, it didn't work! Testdisk reckons the disk to be too small (< 9440361 TB / 8585958 TiB) Quite the disk

Code:
The harddisk (160 GB / 149 GiB) seems too small! (< 246 GB / 229 GiB)
Check the harddisk size: HD jumpers settings, BIOS detection...

The following partitions can't be recovered:
     Partition               Start        End    Size in sectors
>  NTFS                   241172479  482342910  241170432
   FAT32                  290509999  342930030   52420032 [D]
   FAT32                  290510005  342930036   52420032 [NO NAME]

Disk /dev/sda - 160 GB / 149 GiB - 312581808 sectors

The harddisk (160 GB / 149 GiB) seems too small! (< 9440361 TB / 8585958 TiB)
Check the harddisk size: HD jumpers settings, BIOS detection...
These were the results of the initial analysis. The first time it probed the first three partitions correct and started to search from off that third partition's end. After that analysis I did a deep search which made it search for the full 100%. Results:

Code:
The following partitions can't be recovered:
     Partition               Start        End    Size in sectors
>  VMFS                    31326185 18438206466684363 18438206435358178
   VMFS                   146036641 3377907519533190 3377907373496549
   NTFS                   156293119  312584190  156291072
   NTFS                   241172479  482342910  241170432
   FAT32                  290509999  342930030   52420032 [D]
   FAT32                  290510005  342930036   52420032 [NO NAME]

[ Continue ]
VMFS 3698590810, 9440361 TB / 8585958 TiB
The list of partitions was long. I could list files of some supposedly fat12 partitions. The directory list was comprised of "stuff from the 80s".
Code:
-rwxr-xr-x     0     0   7274601  1-Mar-1980 00:03 n
I copied one file out of curiosity. It was a succesfull copy according to Testdisk, but into the target directory nothing was written.

Well, I guess the conclusion is that nothing can be done anymore. Just another heart breaking tale of data loss.

Thanks everyone, for the help. It is much appreciated.
 
  


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
filesystem /var file system suddenly utilizes 100% _mz Linux - Enterprise 7 07-12-2013 05:50 PM
USB drive Reiserfs partitions suddenly corrupted?! AusBob Linux - Hardware 8 01-02-2012 04:52 PM
filesystem for 200gb partitions. SocialEngineer Linux - General 3 05-31-2005 12:49 PM
Create software RAID partitions first, then create filesystem partitions on top of th stefanlasiewski Linux - Software 1 04-28-2004 04:12 PM
Linux Filesystem and Partitions rioch Linux - General 11 10-07-2003 08:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:31 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
Open Source Consulting | Domain Registration