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 03-12-2011, 05:04 PM   #1
ridgedale
LQ Newbie
 
Registered: Mar 2011
Posts: 8

Rep: Reputation: 0
Tar Backup & Broken Pipe Issue


I have a recently configured Squeeze system:
Quote:
Operating system: Debian Linux 6.0
Kernel and CPU: Linux 2.6.32-5-686 on i686
Processor information: AMD Athlon(tm) XP 1900+, 1 cores
Real memory: 502.63 MB total, 88.67 MB used
Local disk space: 1003.43 GB total, 565.60 GB used

Disk name Total size Make and model Partitions Actions
SATA device A 74.53 GB ATA ST380011A 2 IDE parameters
SATA device B 6.03 GB ATA Maxtor 90648D3 1 IDE parameters
SCSI device D 931.51 GB Seagate Portable 1

SATA device A:
Number Type Extent Size Start End Used by
1 Linux 243.17 MB 1 31 /boot
2 Linux LVM 74.29 GB 32 9729 LVM VG debsrv

SATA device B:
Number Type Extent Size Start End Used by
1 Linux LVM 6.03 GB 1 787

SCSI device D:
Number Type Extent Size Start End Used by
1 NTFS 931.51 GB 1 121601 /mnt/Backup
I'm wondering if anyone could help resolve the following problem relating to backup failures:

I mounted a Seagate 1Tb external usb drive (SCSI device C) using the following command:
Quote:
mount -t ntfs-3g /dev/sdc1 /mnt/Backup -o umask=0,nls=utf8
... the device taking in excess of 30 seconds to mount. I was then able browse the contents of the drive without any problem.

However when I run a tar backup from either cron or the command line I get the following error:
Quote:
gzip: stdout: Input/output error
tar: /mnt/Backup/NewBackups/20110308_065435/20110308_065435_Shared.tar.gz: Wrote only 2048 of 10240 bytes
tar: Error is not recoverable: exiting now
tar: Removing leading `/' from member names
tar (child): /mnt/Backup/NewBackups/20110308_065435/20110308_065435_UserShares.tar.gz: Cannot open: Input/output error
tar (child): Error is not recoverable: exiting now
/home/UserShares/
/home/UserShares/CTS/
/home/UserShares/CTS/LYONS/
/home/UserShares/CTS/LYONS/Build Agreement 04th May 2010.pdf
tar: /mnt/Backup/NewBackups/20110308_065435/20110308_065435_UserShares.tar.gz: Cannot write: Broken pipe
tar: Error is not recoverable: exiting now
Shortly after the failure the USB drive reappears unmounted on the system as SCSI device D!

The first few times I ran the backup script it got as far as:
Wrote only 4096 of 10240 bytes

before failing. After which I did some research online and found the following command to disable STANDBY on the USB drive:
Quote:
sdparm --set=STANDBY=0 --long --save /dev/sdc
The current drive settings are as follows:
Quote:
# sdparm -al /dev/sdd
/dev/sdd: Seagate Portable 0130
Direct access device specific parameters: WP=0 DPOFUA=0
Power condition [po] mode page:
IDLE 0 [cha: n, def: 0, sav: 0] Idle timer active
STANDBY 0 [cha: y, def: 1, sav: 0] Standby timer active
ICT 0 [cha: n, def: 0, sav: 0] Idle condition timer (100 ms)
SCT 4294967286 [cha: y, def:3000, sav:4294967286] Standby condition timer (100 ms)
#
Any assistance would be greatly appreciated.
 
Old 03-14-2011, 05:25 AM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
Hi, you could exclude "/home/UserShares/" from backup.

If you can't exclude certain directories from backup, you might consider a different program.

Even though Mandrive supplies a decent backup option, I use simplebackup (from source).

It's not fail proof, I have found that Sometimes I need to edit the config file because it was corrupted.

At least the program tells me the line it errors on, and I can edit it, to make it work.

Like you, (prolly) I have enough mem to "show the errors and keep working".

It's not always as easy as it looks. It changes slightly from system to system.

see how you go.

ps, I meant to mention rsync, look it up

Cheers Glenn
 
Old 03-15-2011, 04:03 AM   #3
ridgedale
LQ Newbie
 
Registered: Mar 2011
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for the feedback, Glenn.

The UserShares directory is one I need to back up - it doesn't contain the Linux users' home directories it's just a directory in /home with an smb share of that name.

I'm not convinced this is a backup software issue. As soon as an attempt is made to write more than a small amount of data the USB drive disconnects!

I've since rebooted, cleared the old mountpoint, mounted the USB drive again and run some tests:

Quote:
mount -t ntfs-3g /dev/sdc1 /mnt/backup
I was able to create and edit a file on the USB drive without any problem:

Quote:
touch /mnt/backup/testfile
Next, I thought I would try to see if I could just do a straight copy of one of the directories I need to backup:

Quote:
# cd /mnt/backup
# pwd
/mnt/backup
# cd NewBackups
# pwd
/mnt/backup/NewBackups
# mkdir 20110315_072940
# ls -l
total 0
drwxrwxrwx 1 root root 0 Mar 8 02:03 20110308_020325
drwxrwxrwx 1 root root 0 Mar 15 07:29 20110315_072940
# cd 20110315_072940
# cp -r /home/UserShares .
Within a few seconds I got the same error as before:

Quote:
cp: writing `./UserShares/20110218_Charlie.pst': Input/output error
cp: cannot create directory `./UserShares/Important': Input/output error
cp: cannot create directory `./UserShares/REC': Input/output error
cp: cannot create directory `./UserShares/Charlie': Input/output error
cp: cannot create directory `./UserShares/YR 1': Input/output error
cp: cannot create regular file `./UserShares/Helpful Tips - Remember to Check These.pdf': Input/output error
# ls
ls: reading directory .: Input/output error
#
I then logged into webmin and checked the Hardware > Partitions on Local Disks section and found the USB drive appearing now as SCSI device D instead of SCSI device C which it was displaying originally.

I checked /var/log/messages:

Quote:
Mar 15 07:31:09 debsrv-mustang kernel: [19432.291306] usb 1-1: USB disconnect, address 2
Mar 15 07:31:09 debsrv-mustang kernel: [19432.291605] sd 2:0:0:0: [sdc] Unhandled error code
Mar 15 07:31:09 debsrv-mustang kernel: [19432.291609] sd 2:0:0:0: [sdc] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
Mar 15 07:31:09 debsrv-mustang kernel: [19432.291616] sd 2:0:0:0: [sdc] CDB: Write(10): 2a 00 44 d5 fa 6f 00 00 50 00
Mar 15 07:31:09 debsrv-mustang kernel: [19432.291690] lost page write due to I/O error on sdc1
Mar 15 07:31:09 debsrv-mustang kernel: [19432.291724] lost page write due to I/O error on sdc1
Mar 15 07:31:09 debsrv-mustang kernel: [19432.291751] lost page write due to I/O error on sdc1
Mar 15 07:31:09 debsrv-mustang kernel: [19432.291778] lost page write due to I/O error on sdc1
Mar 15 07:31:09 debsrv-mustang kernel: [19432.291804] lost page write due to I/O error on sdc1
Mar 15 07:31:09 debsrv-mustang kernel: [19432.291831] lost page write due to I/O error on sdc1
Mar 15 07:31:09 debsrv-mustang kernel: [19432.291858] lost page write due to I/O error on sdc1
Mar 15 07:31:09 debsrv-mustang kernel: [19432.291884] lost page write due to I/O error on sdc1
Mar 15 07:31:09 debsrv-mustang kernel: [19432.291911] lost page write due to I/O error on sdc1
Mar 15 07:31:09 debsrv-mustang kernel: [19432.291937] lost page write due to I/O error on sdc1
Mar 15 07:31:09 debsrv-mustang kernel: [19432.296107] sd 2:0:0:0: [sdc] Unhandled error code
Mar 15 07:31:09 debsrv-mustang kernel: [19432.296112] sd 2:0:0:0: [sdc] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
Mar 15 07:31:09 debsrv-mustang kernel: [19432.296118] sd 2:0:0:0: [sdc] CDB: Write(10): 2a 00 45 44 ee 8f 00 00 f0 00
Mar 15 07:31:28 debsrv-mustang kernel: [19452.052047] usb 1-1: new full speed USB device using uhci_hcd and address 3
Mar 15 07:31:29 debsrv-mustang kernel: [19452.220023] usb 1-1: New USB device found, idVendor=0bc2, idProduct=2300
Mar 15 07:31:29 debsrv-mustang kernel: [19452.220028] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 15 07:31:29 debsrv-mustang kernel: [19452.220033] usb 1-1: Product: Portable
Mar 15 07:31:29 debsrv-mustang kernel: [19452.220036] usb 1-1: Manufacturer: Seagate
Mar 15 07:31:29 debsrv-mustang kernel: [19452.220039] usb 1-1: SerialNumber: 2GH5QJ2G
Mar 15 07:31:29 debsrv-mustang kernel: [19452.220216] usb 1-1: configuration #1 chosen from 1 choice
Mar 15 07:31:29 debsrv-mustang kernel: [19452.222391] scsi3 : SCSI emulation for USB Mass Storage devices
Mar 15 07:31:34 debsrv-mustang kernel: [19457.224477] scsi 3:0:0:0: Direct-Access Seagate Portable 0130 PQ: 0 ANSI: 4
Mar 15 07:31:34 debsrv-mustang kernel: [19457.227046] sd 3:0:0:0: Attached scsi generic sg4 type 0
Mar 15 07:31:34 debsrv-mustang kernel: [19457.233219] sd 3:0:0:0: [sdd] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB)
Mar 15 07:31:34 debsrv-mustang kernel: [19457.236381] sd 3:0:0:0: [sdd] Write Protect is off
Mar 15 07:31:34 debsrv-mustang kernel: [19457.244217] sdd: sdd1
Mar 15 07:31:34 debsrv-mustang kernel: [19457.299197] sd 3:0:0:0: [sdd] Attached SCSI disk
The USB drive was bought a few weeks ago and has had no trouble being used to run backups under SBS2008.
I would be grateful if anyone has any ideas what I can do to get the backups working to the USB drive.

Thanks again.
 
Old 03-15-2011, 08:59 AM   #4
SL00b
Member
 
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375

Rep: Reputation: 112Reputation: 112
I'm not familiar with type ntfs-3g. What happens if you mount it as plain old ntfs?
 
Old 03-18-2011, 01:34 AM   #5
ridgedale
LQ Newbie
 
Registered: Mar 2011
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for your reply, SL00b.

I checked to make sure the ntfsprogs package was installed and it was. So I tried to mount the USB drive's ntfs partition as follows:

Quote:
# fdisk -l

Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6adf005d

Device Boot Start End Blocks Id System
/dev/sdd1 1 121601 976760001 7 HPFS/NTFS

# mount -t ntfs /dev/sdd1 /mnt/backup -o umask=0,nls=utf8
$MFTMirr does not match $MFT (record 0).
Failed to mount '/dev/sdd1': Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.
#
As I am accessing this server remotely it is not possible for me to remove the drive and add it to a Windows PC to run chkdsk /f.

I tried rebooting the server to make sure there was nothing held over from the last ntfs-3g mount/read/write failure and then attempted the ntfs mount operation again with the same result:

Quote:
# fdisk -l

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6adf005d

Device Boot Start End Blocks Id System
/dev/sdc1 1 121601 976760001 7 HPFS/NTFS
#

# mount -t ntfs /dev/sdc1 /mnt/backup -o umask=0,nls=utf8
$MFTMirr does not match $MFT (record 0).
Failed to mount '/dev/sdc1': Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.
#
n.B. You will note that the drive was reassigned to sdc on reboot!

The only reason I wanted to keep the drive in ntfs format is to make sure the drive can be attached to a Windows PC later on to access the data as required.

I'm not sure if wiping the drive and formatting it as ext3 would resolve this issue. But then, if I do, how would I access the contents of the drive with a Windows PC?

Any thoughts would be welcome.
 
Old 03-18-2011, 07:43 PM   #6
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
Hi, I think the problem may be the ntfs (filesystem)

I was under the impression that flash memory drives used fat32. Not ntfs.

Other than that, how's you ram, check it with memtest86.

It won't take long to find out if that is a contributer to the problem (write-caching)

another thing you might try...

I have kernel logging on terminal 12 (ctrl+alt+F12)

If you have it check for messages while the copy is taking place.

Cheers, Glenn
 
Old 03-19-2011, 03:37 AM   #7
ridgedale
LQ Newbie
 
Registered: Mar 2011
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks again for your input, GlennsPref.

Unfortunately, I do not have physical access to the server - only remote access unless I travel to the site of the server.
In any case, if there was a problem with the system's RAM wouldn't the users also be experiencing problems working on and saving their the data to the server?
They don't appear to be having problems in that respect.

As regards the kernel logging attached is a .zip file containing excerpts from recent syslog files that I hope might provide some insight into what is going on.

I may be wrong, but it looks like the drive is dropping the connection to me.

I would welcome any thoughts.

Thanks again.
Attached Files
File Type: txt SyslogExcerpts.txt (68.8 KB, 27 views)
 
  


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
[SOLVED] How to handle a broken pipe exception (SIGPIPE) in FIFO pipe? zyroot998 Programming 5 03-03-2011 08:10 PM
Apache2 EnableSendfile & Error :: Broken pipe: core_output_filter johnsan Linux - Server 14 01-17-2011 12:14 AM
syslog-ng broken pipe issue rustyz82 Linux - Server 6 06-22-2010 10:45 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM

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

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