LinuxQuestions.org
Help answer threads with 0 replies.
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 09-20-2016, 08:48 AM   #1
DRAGSTER_TUNER
LQ Newbie
 
Registered: Apr 2009
Posts: 28

Rep: Reputation: 0
i made a fsck and lost the system


Hi everyone...

I have 2 hds, and they are like that:

sda debian kde
sdb debian xfce + XP

Using sdb as main system, i UNMOUNt the sda and give this commmand:

fsck.ext4 /dev/sda1
tune2fs /dev/sda1

Well, after that, now sda and XP (in sdb) works, BUT XFCE in SDB does not...

Appears messages in BOTH systems...the messages that appears in both are something about READ DMA (see picture...) In sda, after a while, the system enters...in the sdb, stops in something like initramfs (see picture)


In boot, grub still shows me all systems...

As advice someone tells me to use testdisk...well, i didnt know how to use it...

Someone can help me?
Attached Thumbnails
Click image for larger version

Name:	20160912_094320111.jpg
Views:	17
Size:	257.5 KB
ID:	23065   Click image for larger version

Name:	20160912_09421522222.jpg
Views:	19
Size:	259.0 KB
ID:	23066   Click image for larger version

Name:	20160915_2034488.jpg
Views:	17
Size:	232.4 KB
ID:	23067   Click image for larger version

Name:	20160915_2033455.jpg
Views:	18
Size:	237.1 KB
ID:	23068  
 
Old 09-20-2016, 09:12 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,566

Rep: Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093
You have a disk with at least one bad sector. testdisk is not the right tool for dealing with that. Take a look at the smartmontools Bad Block HOWTO. From the messages in the thumbnails, sector 6146 is bad, and that is in some file in partition sdb1. I would need to see the output from "fdisk -l /dev/sdb" to proceed.
 
Old 09-20-2016, 09:32 AM   #3
urbanwks
Member
 
Registered: Sep 2003
Distribution: Slackware64-Current, FreeBSD 12.1, Alpine 5.4, Manjaro 19, Alpine on WSL [Win10]
Posts: 194

Rep: Reputation: 213Reputation: 213Reputation: 213
Sorry, slightly off-topic: I have to know - why two partitions just for different DEs? I'd imagine those are easily switchable within the same installation.
 
Old 09-20-2016, 11:49 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,949
Blog Entries: 11

Rep: Reputation: 5420Reputation: 5420Reputation: 5420Reputation: 5420Reputation: 5420Reputation: 5420Reputation: 5420Reputation: 5420Reputation: 5420Reputation: 5420Reputation: 5420
Quote:
Originally Posted by urbanwks View Post
Sorry, slightly off-topic: I have to know - why two partitions just for different DEs? I'd imagine those are easily switchable within the same installation.
yeah, something's really off in this thread...
 
Old 09-20-2016, 05:35 PM   #5
DRAGSTER_TUNER
LQ Newbie
 
Registered: Apr 2009
Posts: 28

Original Poster
Rep: Reputation: 0
Hi everyone...

Ondoho: I had two different distros in different hds just for in case happens what happened...in case i lost one of them...

Rknichols: Here is the output:

#fdisk -l /dev/sdb
Disco /dev/sdb: 1,4 TiB, 1500301910016 bytes, 2930277168 setores
Unidades: setor de 1 * 512 = 512 bytes
Tamanho de setor (lógico/físico): 512 bytes / 512 bytes
Tamanho E/S (mínimo/ótimo): 512 bytes / 512 bytes
Tipo de rótulo do disco: dos
Identificador do disco: 0x00085ecc

Dispositivo Inicializar Início Fim Setores Tamanho Id Tipo
/dev/sdb1 * 2048 1459095551 1459093504 695,8G 83 Linux
/dev/sdb2 1459103625 2918175119 1459071495 695,8G 7 HPFS/NTFS/exFAT
/dev/sdb3 2918191104 2930276351 12085248 5,8G 82 Linux swap / Solari
root@linux2:/home/linux2#
 
Old 09-20-2016, 07:12 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,566

Rep: Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093
OK, let's start going through the steps in the HOWTO. Assuming that /dev/sdb1 is another ext2/3/4 filesystem (I know -- bad to assume. Is it??), run (as root)
Code:
tune2fs -l /dev/sdb1 | grep Block
If the block size is 4096, then the filesystem block for LBA 6146 is ((6146-2048)/8)=512.25. So, here's asample debugfs session with the part you type in blue:
Code:
debugfs /dev/sdb1
debugfs: testb 512
Block 512 is marked in use
debugfs: icheck 512
Block   Inode number
512     nnnnn
debugfs: ncheck nnnnn
Inode   Pathname
512     /path/to/file/with/error
debugfs: quit
For the ncheck command, copy the inode number reported by the icheck command. That will tell you what file is affected by that error and cannot be fully recovered.

Hopefully you can follow the subsequent steps in the HOWTO from there. If not, post the results from the above, and I'll try to help a bit more.
 
Old 09-21-2016, 07:38 AM   #7
DRAGSTER_TUNER
LQ Newbie
 
Registered: Apr 2009
Posts: 28

Original Poster
Rep: Reputation: 0
Unfortunatelly, something went wrong:

# tune2fs -l /dev/sdb1 | grep Block
Block count: 182386688
Block size: 4096
Blocks per group: 32768
root@linux2:/home/linux2# debugfs /dev/sdb1
debugfs 1.42.5 (29-Jul-2012)
debugfs: testb 512
Block 512 marked in use
debugfs: icheck 512
icheck: Attempt to read block from filesystem resulted in short read while calling ext2fs_block_iterate
Block Inode number
512 <block not found>
debugfs:



Didnt find in how to this issue...



Dumb question:

what happens if i give this commands?

e2fsck -f /dev/sdb1
e2fsck -f -b 8193 /dev/sdb1 * (i dunno if i use 8193 or 16384 or 32768) in case of use this command...
 
Old 09-21-2016, 09:32 AM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,566

Rep: Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093
Quote:
Originally Posted by DRAGSTER_TUNER View Post
debugfs: icheck 512
icheck: Attempt to read block from filesystem resulted in short read while calling ext2fs_block_iterate
Block Inode number
512 <block not found>
It appears that some of the sectors containing filesystem metadata are bad.
Quote:
what happens if i give this commands?

e2fsck -f /dev/sdb1
e2fsck -f -b 8193 /dev/sdb1 * (i dunno if i use 8193 or 16384 or 32768) in case of use this command...
Running fsck in the presence of known hardware problems is almost guaranteed to cause further damage that will probably not be recoverable.

Let's see how bad this drive might be. Post the output from
Code:
smartctl -A /dev/sdb
Please wrap that output in [CODE]...[/CODE] tags to keep it readable.

You will probably need to get another disk drive at least as large as this one and use ddrescue to make an image of the sectors that can be recovered. You can find ddrescue plus a lot of other useful tools on SystemRescueCD.
 
Old 09-21-2016, 05:59 PM   #9
DRAGSTER_TUNER
LQ Newbie
 
Registered: Apr 2009
Posts: 28

Original Poster
Rep: Reputation: 0
Here is:

Code:
smartctl -A /dev/sdb
smartctl 6.4 2015-06-04 r4109 [x86_64-linux-4.1.30-std481-amd64] (local build)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE
UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   099   087   051    Pre-fail
Always       -       3346
  3 Spin_Up_Time            0x0007   071   071   011    Pre-fail
Always       -       9510
  4 Start_Stop_Count        0x0032   097   097   000    Old_age
Always       -       2791
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail
Always       -       0
  7 Seek_Error_Rate         0x000f   100   100   051    Pre-fail
Always       -       0
  8 Seek_Time_Performance   0x0025   100   100   015    Pre-fail
Offline      -       0
  9 Power_On_Hours          0x0032   094   094   000    Old_age
Always       -       28093
 10 Spin_Retry_Count        0x0033   100   100   051    Pre-fail
Always       -       0
 11 Calibration_Retry_Count 0x0012   100   100   000    Old_age
Always       -       8
 12 Power_Cycle_Count       0x0032   097   097   000    Old_age
Always       -       2789
 13 Read_Soft_Error_Rate    0x000e   099   087   000    Old_age
Always       -       3346
183 Runtime_Bad_Block       0x0032   100   100   000    Old_age
Always       -       0
184 End-to-End_Error        0x0033   100   100   000    Pre-fail
Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age
Always       -       4753
188 Command_Timeout         0x0032   100   100   000    Old_age
Always       -       0
190 Airflow_Temperature_Cel 0x0022   079   051   000    Old_age
Always       -       21 (Min/Max 21/21)
194 Temperature_Celsius     0x0022   077   050   000    Old_age
Always       -       23 (Min/Max 21/23)
195 Hardware_ECC_Recovered  0x001a   100   100   000    Old_age
Always       -       198546
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age
Always       -       0
197 Current_Pending_Sector  0x0012   097   097   000    Old_age
Always       -       123
198 Offline_Uncorrectable   0x0030   100   100   000    Old_age
Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   100   100   000    Old_age
Always       -       0
200 Multi_Zone_Error_Rate   0x000a   100   100   000    Old_age
Always       -       0
201 Soft_Read_Error_Rate    0x000a   253   253   000    Old_age
Always       -       45

#
 
Old 09-21-2016, 11:22 PM   #10
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,566

Rep: Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093
Quote:
Originally Posted by DRAGSTER_TUNER View Post
Code:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE     UPDATED  WHEN_FAILED RAW_VALUE
197 Current_Pending_Sector  0x0012   097   097   000    Old_age  Always       -       123
That is not good. The 123 sectors pending reallocation are ones that return an I/O error when read. There could be more bad sectors not yet marked "pending" simply because nothing has attempted to read them. That's just too many sectors to be practical to fix, one by one, by going through the steps in the HOWTO.

You need to recover as much as possible by using ddrescue to make an image onto a new disk. You could then zero out the entire disk, which should cause all the bad sectors to be remapped, and then see what shape the disk is in by looking at parameter 5, "Reallocated_Sector_Ct", but even if it's no more than the 123 known bad sectors, that is too many to consider the drive to be trustworthy. It's still worth taking a look, though. Sometimes sectors are bad due to transient conditions (vibration, power glitch) rather than physical medium faults. Those sectors become "good" (not reallocated) when they are rewritten.

Really, you should make a second copy of the image for your recovery work. At some point you're going to have to run fsck on the image, and you shouldn't be doing that on your only good copy.
 
Old 09-22-2016, 08:24 AM   #11
DRAGSTER_TUNER
LQ Newbie
 
Registered: Apr 2009
Posts: 28

Original Poster
Rep: Reputation: 0
Hmmmmmm....

rknichols im reconsidering erase all the partition and install all debian again...its the fast and non-headache option...i already made a backup of all my files i have in that partition, so ill not lose anything.

If i install an fresh debian above this one, it will fix this blocks? or have something i have to do before install the new fresh one?

Thanx for all the support until now!

 
Old 09-22-2016, 09:26 AM   #12
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,566

Rep: Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093
Quote:
Originally Posted by DRAGSTER_TUNER View Post
If i install an fresh debian above this one, it will fix this blocks? or have something i have to do before install the new fresh one?
I still advise zeroing at least that Linux partition (sdb1) and the swap partition (sdb3). A fresh install will "sort of" fix the bad blocks. Any blocks that get written during the install will be fixed, but there could still be bad sectors in the free space pending reallocation. Bad blocks in the free space should not cause a problem (they will be written before anything tries to read them), but their possible presence makes it hard to know what the real health of the disk might be.

What is in that NTFS partition (sdb2)? If you don't want to zero that partition too, you should at least do a quick scan for bad blocks:
Code:
dd if=/dev/sdb2 of=/dev/null bs=32k conv=noerror
That will reveal how many of the 64-sector blocks contain at least one bad sector.
 
  


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
How to do the system repair / fsck elainelaw Linux - Newbie 5 04-27-2010 05:49 PM
how to recover lost files after fsck? edenCC Linux - Server 3 12-26-2007 01:31 AM
fsck and lost hard drive space LinuxGeek Linux - Software 1 07-19-2005 08:17 PM
How to fsck / while system running LinuxGeek Linux - Software 2 07-19-2005 10:43 AM
i made some more software installing and lost my other apps how do i undo XoTRIBALoX Linux - Newbie 2 12-15-2003 02:49 AM

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

All times are GMT -5. The time now is 05:15 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