Read I O Error Unix
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
Input/output Error Linux
and policies of this site About Us Learn more about Stack Overflow linux i/o error dev sda sector the company Business Learn more about hiring developers or posting ads with us Unix & Linux Questions Tags Users i/o error linux Badges Unanswered Ask Question _ Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes
I/o Error Unix
a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top “Input/output error” when accessing a directory up vote 40 down vote favorite 9 I want to list and remove the content of a directory on a removable hard drive. But I have experienced "Input/output error":
Linux Fsck
$ rm pic -R rm: cannot remove `pic/60.jpg': Input/output error rm: cannot remove `pic/006.jpg': Input/output error rm: cannot remove `pic/008.jpg': Input/output error rm: cannot remove `pic/011.jpg': Input/output error $ ls -la pic ls: cannot access pic/60.jpg: Input/output error -????????? ? ? ? ? ? 006.jpg -????????? ? ? ? ? ? 006.jpg -????????? ? ? ? ? ? 011.jpg I was wondering what the problem is? How can I recover or remove the directory pic and all of its content? My OS is Ubuntu 12.04, and the removable hard drive has ntfs filesystem. Other directories not containing or inside pic on the removable hard drive are working fine. Added: Last part of output of dmesg after I tried to list the content of the directory: [19000.712070] usb 1-1: new high-speed USB device number 2 using ehci_hcd [19000.853167] usb-storage 1-1:1.0: Quirks match for vid 05e3 pid 0702: 520 [19000.853195] scsi5 : usb-storage 1-1:1.0 [19001.856687] scsi 5:0:0:0: Direct-Access ST316002 1A 0811 PQ: 0 ANSI: 0 [19001.858821] sd 5:0:0:0: Attached scsi generic sg2 type 0 [19001.861733] sd 5:0:0:0: [sdb] 312581808 512-byte logical blocks: (160 GB/149 GiB) [19001.86
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow ddrescue the company Business Learn more about hiring developers or posting ads with us Unix &
Dmesg
Linux Questions Tags Users Badges Unanswered Ask Question _ Unix & Linux Stack Exchange is a question and answer site for users e2fsck of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise http://unix.stackexchange.com/questions/39905/input-output-error-when-accessing-a-directory to the top I/O errors on hard disk on Linux boot up vote 2 down vote favorite 1 Here is a screenshot of booting Arch. I guess the reason is that I force poweroff my Arch linux many times. (I already force poweroff my Arch because my firefox flash plugin use too much memory to stop my system.) Note: I can boot my Windows 7 system on the same drive disk. So I think http://unix.stackexchange.com/questions/68147/i-o-errors-on-hard-disk-on-linux-boot it is not a disk problem, mostly is a partion problem. Update: I check out more information, the partion /dev/sda9 is /home directory. And always error on same sector 798717984. I use DiskGenius software under Windows to check error. Then found an error. and that partion is not formated. I want to recover my Arch linux. How to solve this ? If I can not fix this error, then how to get the partion data out ? Update2: I really hope to save this partion data out. Because I have a lot of important things in this partion. I think the first step is backup this bad partion or whole hard drive into an image file (what image file ?), then let someone who can fix this partion to fix. More update: After I use DiskGenius software to fix the partion sector error. Then I use e2fsck to check. get error: fsck.ext4: Bad magic number in super-block while trying to open /dev/sda9. /dev/sda9: The superblock could not be read or does not describe a correct ext2 filesystem. VFS: can't find ext4 filesystem. (my this broken partion /home -> /dev/sda9 is ext4 when I create it before.) And I execute command # mke2fs /dev/sda9 to get block information: OS type: Linux Block size: 4096 (log=2) Fragment size=4096 (log=2) Stride = 0 block
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack http://serverfault.com/questions/498900/intentionally-cause-an-i-o-error-in-linux Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and http://man7.org/linux/man-pages/man2/read.2.html network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Intentionally cause o error an I/O error in Linux? up vote 38 down vote favorite 13 Is there anyway, with Linux, to purposely cause a block device to report an I/O error, or possibly simulate one for testing purposes? linux linux-kernel block-device share|improve this question asked Apr 12 '13 at 20:15 Dok 51847 Are you simulating a disk failure? Perhaps you could mount a directory and then unmount it while it was in use. o error unix –Shef Apr 12 '13 at 20:50 2 I'd write a little kernel module that you could load with modprobe, behaving like a block device, and then another little program that sends ioctl()'s to the driver to make it return the value you want. –ott-- Apr 12 '13 at 21:06 Same question on Stack Overlflow and on Unix and Linux. –Gilles May 29 '13 at 21:30 To follow up the comment @Gilles made, this was was also asked on stackoverflow.com/questions/1361518/… (several different fault injection answers) and stackoverflow.com/questions/1870696/… (use device mapper). –Anon Jun 14 '14 at 5:30 add a comment| 5 Answers 5 active oldest votes up vote 48 down vote accepted Yes, theres a very plausible way to do this with device mapper. The device mapper can recombine block devices into a new mapping/order of your choosing. LVM does this. It also supports other targets, (some which are quite novel) like 'flakey' to simiulate a failing disk and 'error' to simulate failed regions of disk. One can construct a device which deliberate has IO blackholes on it which will report IO errors when crossed. First, create some virtual volume to use as a target and make it addressable as a block device. dd if=/dev/zero of=/var/lib/virtualblock.img bs=512 count=1048576 losetup /dev/
read from a file descriptor SYNOPSIS top #include