LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   cant move file between HDDs - fsck says clean (https://www.linuxquestions.org/questions/linux-software-2/cant-move-file-between-hdds-fsck-says-clean-655327/)

Nonc 07-12-2008 11:59 AM

cant move file between HDDs - fsck says clean
 
Hi,

ive moved a bunch of files from one HDD to another with no problem, but there are 26 or so where it tries to but ends up with the error:

"There was an error copying the file into /media/media/.
Error reading from file: Input/output error"

ive unmounted the filesystem and run fsck and e2fsck and they both come back telling me its clean.

both filesystems are ext2, im running ubuntu 8.04

i have no idea what to try next. all help appreciated.

cheers
nonc

stress_junkie 07-12-2008 12:31 PM

I have found limits on the cp command copying very large files or groups of very large files. If you are using the cp command you could try using tar or dd. I copy large directories, such as my music collection, from one partition to a NAS using tar.
Code:

cd music
tar -c . | tar -C /home/user/iomega.music -xvkp .

You could specify individual files in that tar command if you wanted to do so.
Code:

tar -c bigfile | tar -C /home/user/iomega.music -xvkp .
Or you could use dd
Code:

dd if=bigfile of=/home/user/iomega.music/bigfile conv=notrunc,noerror
I threw in the conv=notrunc,noerror just in case their is something wrong with the structure of the file. dd will copy the entire thing whether there is an EOF in the middle or whatever might be wrong with it.

jailbait 07-12-2008 12:52 PM

You might have some bad blocks on the input partition. You could umount the partition and run the badblocks program in non-destructive mode to see if you have bad spots on the hard drive. See:

man badblocks

-----------------
Steve Stites

Nonc 07-12-2008 01:29 PM

thanks stress_junkie, i tried the dd and it didnt work

Code:

dd if=/media/shared/brokenfiles/0205.avi of=/media/media/brokenfiles/02505.avi conv=notrunc,noerror
dd: reading `/media/shared/brokenfiles/0205.avi': Input/output error
3608+0 records in
3608+0 records out
1847296 bytes (1.8 MB) copied, 3.52715 s, 524 kB/s
dd: reading `/media/shared/brokenfiles/0205.avi': Input/output error
3608+0 records in
3608+0 records out
1847296 bytes (1.8 MB) copied, 5.55094 s, 333 kB/s
dd: reading `/media/shared/brokenfiles/0205.avi': Input/output error
3608+0 records in
3608+0 records out
1847296 bytes (1.8 MB) copied, 7.56994 s, 244 kB/s
dd: reading `/media/shared/brokenfiles/0205.avi': Input/output error
3608+0 records in
3608+0 records out
1847296 bytes (1.8 MB) copied, 9.58688 s, 193 kB/s
dd: reading `/media/shared/brokenfiles/0205.avi': Input/output error
3608+0 records in
3608+0 records out
1847296 bytes (1.8 MB) copied, 11.7179 s, 158 kB/s
dd: reading `/media/shared/brokenfiles/0205.avi': Input/output error
3608+0 records in
3608+0 records out
1847296 bytes (1.8 MB) copied, 15.2349 s, 121 kB/s
dd: reading `/media/shared/brokenfiles/0205.avi': Input/output error
3608+0 records in
3608+0 records out

i then tried archiving it and then moving it and that didnt work either (same error)

and thanks jailbait

here is the terminal output
Code:

sudo badblocks /dev/sdc1 -n
6912
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963

and then it just kind of stops

so how do i go about fixing these blocks, hopefully whilst preserving the data

nonc

jailbait 07-12-2008 03:16 PM

Quote:

Originally Posted by Nonc (Post 3212424)

so how do i go about fixing these blocks, hopefully whilst preserving the data

Run e2fsck with the -c option. e2fsck will move any bad blocks to a "unusable" chain. This will lose data although the data in the bad blocks is probably lost anyway. The portions of the bad files that are on good blocks can then be copied.

If you run e2fsck with the -c option then you should also look in the lost+found directory for the partition you run e2fsck against. e2fsck may place orphan files and directories in lost+found and give them a number instead of a name.

See:

man e2fsck

---------------
Steve Stites

Nonc 07-13-2008 09:17 AM

perfect, problem solved, thanks very much.

it looks like the drive is clean now and all badblocks are fixed. i was planning once i had copied all the stuff off it to use it as a backup harddrive, hopefully like 'time machine' for mac, but backing up to a separate partiton. do you reckon it will be all right to use that HDD given whats just happend to it?

jailbait 07-13-2008 12:30 PM

Quote:

Originally Posted by Nonc (Post 3212987)

it looks like the drive is clean now and all badblocks are fixed. i was planning once i had copied all the stuff off it to use it as a backup harddrive, hopefully like 'time machine' for mac, but backing up to a separate partiton. do you reckon it will be all right to use that HDD given whats just happend to it?

What fsck has done is taken the bad blocks out of use. The remaining portion of the partition is just as usable as ever.

---------------------
Steve Stites

jiml8 07-13-2008 06:47 PM

If these bad blocks are just starting to appear, you had better keep a close eye on that drive; it may be failing.

You may have had the problem because, for instance, the kids were wrestling and banged against the computer, causing a head crash. In this case, mapping out the bad blocks probably fixes you up. But sometimes this happens because a media failure is occurring, and those tend to spread.

If I were you I would enable SMART on the drive and have it run built-in read/write tests periodically, and I would monitor the SMART output using smartctl -a for awhile to make sure the problem is gone.

Nonc 07-16-2008 06:09 AM

cheers jiml8

i have had a read of the manual page, and im not sure i understand how to use it fully, but ive done the -a option and it looks fine but it does say that it is "FAILING NOW" for "5 Reallocated_Sector_Ct"

below is the output, i cant tell if anything means its failing or not

Code:

smartctl version 5.37 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Model Family:    Maxtor DiamondMax Plus 9 family
Device Model:    Maxtor 6Y120L0
Serial Number:    Y320QQRE
Firmware Version: YAR41BW0
User Capacity:    122,942,324,736 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:  7
ATA Standard is:  ATA/ATAPI-7 T13 1532D revision 0
Local Time is:    Wed Jul 16 12:03:15 2008 BST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: FAILED!
Drive failure expected in less than 24 hours. SAVE ALL DATA.
See vendor-specific Attribute list for failed Attributes.

General SMART Values:
Offline data collection status:  (0x82)        Offline data collection activity
                                        was completed without error.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (  0)        The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                  ( 242) seconds.
Offline data collection
capabilities:                          (0x5b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        No Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003)        Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01)        Error logging supported.
                                        No General Purpose Logging support.
Short self-test routine
recommended polling time:          (  2) minutes.
Extended self-test routine
recommended polling time:          (  54) minutes.

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
  3 Spin_Up_Time            0x0027  201  200  063    Pre-fail  Always      -      21021
  4 Start_Stop_Count        0x0032  253  253  000    Old_age  Always      -      1247
  5 Reallocated_Sector_Ct  0x0033  001  001  063    Pre-fail  Always  FAILING_NOW 2556
  6 Read_Channel_Margin    0x0001  253  253  100    Pre-fail  Offline      -      0
  7 Seek_Error_Rate        0x000a  253  252  000    Old_age  Always      -      0
  8 Seek_Time_Performance  0x0027  253  241  187    Pre-fail  Always      -      59678
  9 Power_On_Minutes        0x0032  217  217  000    Old_age  Always      -      695h+52m
 10 Spin_Retry_Count        0x002b  253  252  157    Pre-fail  Always      -      0
 11 Calibration_Retry_Count 0x002b  253  252  223    Pre-fail  Always      -      0
 12 Power_Cycle_Count      0x0032  246  246  000    Old_age  Always      -      2948
192 Power-Off_Retract_Count 0x0032  253  253  000    Old_age  Always      -      0
193 Load_Cycle_Count        0x0032  253  253  000    Old_age  Always      -      0
194 Temperature_Celsius    0x0032  253  253  000    Old_age  Always      -      53
195 Hardware_ECC_Recovered  0x000a  253  252  000    Old_age  Always      -      1415
196 Reallocated_Event_Count 0x0008  241  241  000    Old_age  Offline      -      12
197 Current_Pending_Sector  0x0008  253  247  000    Old_age  Offline      -      2
198 Offline_Uncorrectable  0x0008  001  001  000    Old_age  Offline      -      4627
199 UDMA_CRC_Error_Count    0x0008  199  199  000    Old_age  Offline      -      0
200 Multi_Zone_Error_Rate  0x000a  253  252  000    Old_age  Always      -      0
201 Soft_Read_Error_Rate    0x000a  253  202  000    Old_age  Always      -      1
202 TA_Increase_Count      0x000a  253  252  000    Old_age  Always      -      0
203 Run_Out_Cancel          0x000b  253  252  180    Pre-fail  Always      -      0
204 Shock_Count_Write_Opern 0x000a  253  252  000    Old_age  Always      -      0
205 Shock_Rate_Write_Opern  0x000a  253  252  000    Old_age  Always      -      0
207 Spin_High_Current      0x002a  253  252  000    Old_age  Always      -      0
208 Spin_Buzz              0x002a  253  252  000    Old_age  Always      -      0
209 Offline_Seek_Performnce 0x0024  194  189  000    Old_age  Offline      -      0
 99 Unknown_Attribute      0x0004  253  253  000    Old_age  Offline      -      0
100 Unknown_Attribute      0x0004  253  253  000    Old_age  Offline      -      0
101 Unknown_Attribute      0x0004  253  253  000    Old_age  Offline      -      0

SMART Error Log Version: 1
ATA Error Count: 26705 (device log contains only the most recent five errors)
        CR = Command Register [HEX]
        FR = Features Register [HEX]
        SC = Sector Count Register [HEX]
        SN = Sector Number Register [HEX]
        CL = Cylinder Low Register [HEX]
        CH = Cylinder High Register [HEX]
        DH = Device/Head Register [HEX]
        DC = Device Command Register [HEX]
        ER = Error register [HEX]
        ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 26705 occurred at disk power-on lifetime: 11866 hours (494 days + 10 hours)
  When the command that caused the error occurred, the device was in an unknown state.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 06 77 36 00 f0  Error: UNC 6 sectors at LBA = 0x00003677 = 13943

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC  Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 77 36 00 f0 08      06:02:34.896  READ DMA
  f8 00 00 00 00 00 f0 08      06:02:34.880  READ NATIVE MAX ADDRESS
  ec 00 00 00 00 00 b0 0a      06:02:34.880  IDENTIFY DEVICE
  ef 03 45 00 00 00 b0 0a      06:02:34.864  SET FEATURES [Set transfer mode]
  f8 00 00 00 00 00 f0 08      06:02:34.864  READ NATIVE MAX ADDRESS

Error 26704 occurred at disk power-on lifetime: 11866 hours (494 days + 10 hours)
  When the command that caused the error occurred, the device was in an unknown state.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 06 77 36 00 f0  Error: UNC 6 sectors at LBA = 0x00003677 = 13943

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC  Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 77 36 00 f0 08      06:02:33.856  READ DMA
  f8 00 00 00 00 00 f0 08      06:02:33.840  READ NATIVE MAX ADDRESS
  ec 00 00 00 00 00 b0 0a      06:02:33.840  IDENTIFY DEVICE
  ef 03 45 00 00 00 b0 0a      06:02:33.824  SET FEATURES [Set transfer mode]
  f8 00 00 00 00 00 f0 08      06:02:33.824  READ NATIVE MAX ADDRESS

Error 26703 occurred at disk power-on lifetime: 11866 hours (494 days + 10 hours)
  When the command that caused the error occurred, the device was in an unknown state.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 06 77 36 00 f0  Error: UNC 6 sectors at LBA = 0x00003677 = 13943

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC  Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 77 36 00 f0 08      06:02:32.816  READ DMA
  f8 00 00 00 00 00 f0 08      06:02:32.800  READ NATIVE MAX ADDRESS
  ec 00 00 00 00 00 b0 0a      06:02:32.800  IDENTIFY DEVICE
  ef 03 45 00 00 00 b0 0a      06:02:32.800  SET FEATURES [Set transfer mode]
  f8 00 00 00 00 00 f0 08      06:02:32.784  READ NATIVE MAX ADDRESS

Error 26702 occurred at disk power-on lifetime: 11866 hours (494 days + 10 hours)
  When the command that caused the error occurred, the device was in an unknown state.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 06 77 36 00 f0  Error: UNC 6 sectors at LBA = 0x00003677 = 13943

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC  Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 77 36 00 f0 08      06:02:31.776  READ DMA
  f8 00 00 00 00 00 f0 08      06:02:31.760  READ NATIVE MAX ADDRESS
  ec 00 00 00 00 00 b0 0a      06:02:31.760  IDENTIFY DEVICE
  ef 03 45 00 00 00 b0 0a      06:02:31.744  SET FEATURES [Set transfer mode]
  f8 00 00 00 00 00 f0 08      06:02:31.744  READ NATIVE MAX ADDRESS

Error 26701 occurred at disk power-on lifetime: 11866 hours (494 days + 10 hours)
  When the command that caused the error occurred, the device was in an unknown state.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 06 77 36 00 f0  Error: UNC 6 sectors at LBA = 0x00003677 = 13943

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC  Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 77 36 00 f0 08      06:02:30.736  READ DMA
  f8 00 00 00 00 00 f0 08      06:02:30.720  READ NATIVE MAX ADDRESS
  ec 00 00 00 00 00 b0 0a      06:02:30.720  IDENTIFY DEVICE
  ef 03 45 00 00 00 b0 0a      06:02:30.720  SET FEATURES [Set transfer mode]
  f8 00 00 00 00 00 f0 08      06:02:30.704  READ NATIVE MAX ADDRESS

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]


SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.


resetreset 07-16-2008 12:30 PM

SMART overall-health self-assessment test result: FAILED!
Drive failure expected in less than 24 hours. SAVE ALL DATA.


I think that means its failing.


All times are GMT -5. The time now is 09:55 AM.