You are not logged in.

#1 2012-07-08 03:24:08

tuxzz
Member
Registered: 2012-07-08
Posts: 18

[Solved] Why is there a lot of I / O error?

I am using Archlinux.I install it into a loop file is located in an NTFS.And modify the init script in initcpio can start.But the shutdown always a lot of I / O error.What is the reason?
The loop file is jfs. root=/dev/sdb7 loop=/arch/arch.img

My init script:

#!/usr/bin/ash
PATH=/usr/bin
udevd_running=0

if [ -x /usr/bin/systemd-timestamp ]; then
    RD_TIMESTAMP=$(systemd-timestamp)
fi

. /init_functions

mount -t proc proc /proc -o nosuid,noexec,nodev
mount -t sysfs sys /sys -o nosuid,noexec,nodev
mount -t devtmpfs dev /dev -o mode=0755,nosuid
mount -t tmpfs run /run -o nosuid,nodev,mode=0755
mkdir -m755 /run/initramfs

# parse the kernel command line
parse_cmdline

for d in ${disablehooks//,/ }; do
    [ -e "/hooks/$d" ] && chmod 644 "/hooks/$d"
done
. /config
run_hookfunctions 'run_earlyhook' 'early hook' $EARLYHOOKS
[ -n "${earlymodules//[[:space:]]}" ] && modprobe -qab ${earlymodules//,/ }
[ -n "${MODULES//[[:space:]]}" ] && modprobe -qab $MODULES

# If rootdelay is empty or not a non-negative integer, set it to 10
if [ -z "${rootdelay}" ] || ! [ "${rootdelay}" -ge 0 ]; then
    rootdelay=10
fi

run_hookfunctions 'run_hook' 'hook' $HOOKS

# honor the old behavior of break=y as a synonym for break=premount
if [ "${break}" = "y" ] || [ "${break}" = "premount" ]; then
    echo ":: Pre-mount break requested, type 'exit' to resume operation"
    launch_interactive_shell
fi

rootdev=$(resolve_device "$root") && root=$rootdev
unset rootdev

# Mount root at /new_root
mkdir /hostmount.ntfs-3g ${root} /hostfsck.jfs /host${loop}mount -o loop=/dev/loop0 /host${loop} /new_rootmount -o bind /host /new_root/host
run_hookfunctions 'run_latehook' 'late hook' $LATEHOOKS
run_hookfunctions 'run_cleanuphook' 'cleanup hook' $CLEANUPHOOKS

init=${init:-/sbin/init}

if [ "${break}" = "postmount" ]; then
    echo ":: Post-mount break requested, type 'exit' to resume operation"
    launch_interactive_shell
fi

exec env -i \
    "TERM=$TERM" \
    "RD_TIMESTAMP=$RD_TIMESTAMP" \
    /usr/bin/switch_root /new_root $init "$@"

# vim: set ft=sh ts=4 sw=4 et:

fstab:

# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>
tmpfs		/tmp	tmpfs	nodev,nosuid	0	0
/dev/loop0 / jfs defaults,loop 0 0
/host/arch/swap.img swap swap defaults,loop 0 0

Last edited by tuxzz (2012-09-09 01:43:45)

Offline

#2 2012-07-08 13:37:24

MadTux
Member
Registered: 2009-09-20
Posts: 553

Re: [Solved] Why is there a lot of I / O error?

Maybe I overlooked it, but can you give examples of these I/O errors?

Offline

#3 2012-07-09 05:34:34

tuxzz
Member
Registered: 2012-07-08
Posts: 18

Re: [Solved] Why is there a lot of I / O error?

Thanks for your reply. This is some examples:

[...] Buffer I/O error on device sdb7, logical block XXXXXXX
[...] end_request: I/O error, dev sdb , sector 0
.
.
.
.
[...] Loop: Write error at byte offset XXXXXXX, length 4096.
.
.
.
.
Init:no more processes left in this runlevel

Offline

#4 2012-07-09 14:12:38

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: [Solved] Why is there a lot of I / O error?

I've only seen errors like yours twice before and both times it was a symptom of a failing hard drive. Now, I've never had a setup like yours with Linux installed on an image file in an NTFS filesystem, so I imagine there are plenty of other possible causes, but if you haven't backed up recently you should take immediate steps to do so all the same.

The first thing I'd do is boot into Windows and check the NTFS partition for errors. Do the surface scan too if that's still a thing. If that doesn't bring anything up then I'd start troubleshooting from the Linux side.

Offline

#5 2012-07-10 08:57:25

tuxzz
Member
Registered: 2012-07-08
Posts: 18

Re: [Solved] Why is there a lot of I / O error?

Trent,

Thank you for replying.I checked my NTFS partition. But I can't find any problem in my partition or Linux.

Offline

#6 2012-07-10 12:48:54

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: [Solved] Why is there a lot of I / O error?

Hm. That doesn't necessarily mean there's nothing wrong with your hard drive, but ... maybe it's a good sign.

The only thing that comes to mind is perhaps, because the root fs is unmounted last (IIRC), /dev/sdb7 is already unavailable somehow at the end of the shutdown process and so you can't access the root filesystem which is on it.

... I just noticed that your comment and initscripts imply that the loop file is JFS, but /etc/fstab says ext4. Probably unrelated but was that an accident?

Offline

#7 2012-07-23 05:53:10

tuxzz
Member
Registered: 2012-07-08
Posts: 18

Re: [Solved] Why is there a lot of I / O error?

Trent wrote:

Hm. That doesn't necessarily mean there's nothing wrong with your hard drive, but ... maybe it's a good sign.

The only thing that comes to mind is perhaps, because the root fs is unmounted last (IIRC), /dev/sdb7 is already unavailable somehow at the end of the shutdown process and so you can't access the root filesystem which is on it.

... I just noticed that your comment and initscripts imply that the loop file is JFS, but /etc/fstab says ext4. Probably unrelated but was that an accident?

Thanks for your reply,
This is a clerical error. I had to change it.
But how to umount /dev/sdb7 after root fs? /dev/sdb7 has been bound in the directory in root fs.

Last edited by tuxzz (2012-07-23 06:09:54)

Offline

#8 2012-07-26 09:08:24

tuxzz
Member
Registered: 2012-07-08
Posts: 18

Re: [Solved] Why is there a lot of I / O error?

Nobody reply?

Offline

#9 2012-09-09 01:41:42

tuxzz
Member
Registered: 2012-07-08
Posts: 18

Re: [Solved] Why is there a lot of I / O error?

Thanks Trant and Madtux. smile
Add "-o $(pidof mount.ntfs-3g)" to kill_all_wait() in /etc/rc.d/functions can reslove.

------------------------------------ End of topic ------------------------------------

Last edited by tuxzz (2012-09-09 01:42:38)

Offline

Board footer

Powered by FluxBB