Temat: Nie montuje HDD po zaniku napięcia
Witam ponownie
Tym razem mam problem z montowaniem HDD i Swapem
Otóż w przypadku zaniku napięcia po uruchomieniu routera nie ma zamontowanego HDD i Swapa.
Po takim "wypadku" bez problemu można podmontować dysk z palca. Po wykonaniu rebootu routera też wszystko działa poprawnie (przynajmniej tak mi się wydaje).
Co może być przyczyną takiego stanu rzeczy ??
W przypadku zaniku napięcia:
root@OpenWrt:~# free
total used free shared buffers
Mem: 30552 16284 14268 0 1288
Swap: 0 0 0
Total: 30552 16284 14268
root@OpenWrt:~# df
Filesystem 1k-blocks Used Available Use% Mounted on
rootfs 1600 1600 0 100% /
/dev/root 1600 1600 0 100% /rom
tmpfs 15276 184 15092 1% /tmp
/dev/mtdblock/4 5824 1860 3964 32% /jffs
mini_fo:/jffs 1600 1600 0 100% /
root@OpenWrt:~#po restarcie routera (reebot) wszystko (chyba) wraca do normy
root@OpenWrt:/# free
total used free shared buffers
Mem: 30552 19004 11548 0 1528
Swap: 497972 0 497972
Total: 528524 19004 509520
8988 509536
root@OpenWrt:/#
root@OpenWrt:/# df
Filesystem 1k-blocks Used Available Use% Mounted on
rootfs 1600 1600 0 100% /
/dev/root 1600 1600 0 100% /rom
tmpfs 15276 612 14664 4% /tmp
/dev/mtdblock/4 5824 1860 3964 32% /jffs
mini_fo:/jffs 1600 1600 0 100% /
/dev/scsi/host0/bus0/target0/lun0/part2
307141908 32812 291752004 0% /hddroot@OpenWrt:/etc# cat fstab
# WARNING: this is an auto generated file, please use uci to set sta tic filesystems
/dev/scsi/host0/bus0/target0/lun0/part2 /hdd ext3 rw,noatime 0 0
/dev/scsi/host0/bus0/target0/lun0/part1 none swap sw 0 0root@OpenWrt:/etc/config# cat fstab
config mount
option device /dev/scsi/host0/bus0/target0/lun0/part2
option target /hdd
option fstype ext3
option options rw,noatime
option enabled 1
config swap
option device /dev/scsi/host0/bus0/target0/lun0/part1
option enabled 1root@OpenWrt:/etc/init.d# cat fstab
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org
START=20
do_mount() {
local cfg="$1"
config_get fstype "$cfg" fstype
fstype="${fstype:-auto}"
config_get options "$cfg" options
options="${options:-rw}"
config_get device "$cfg" device
[ -n "$device" ] || return 0
config_get target "$cfg" target
[ -n "$target" ] || return 0
mkdir -p $target
config_get_bool enabled "$cfg" "enabled" '1'
[ "$enabled" -eq 0 ] && options="noauto,$options"
echo "$device $target $fstype $options 0 0" >> /tmp/fstab
}
do_swapon() {
local cfg="$1"
config_get device "$cfg" device
[ -n "$device" ] || return 0
config_get_bool enabled "$cfg" "enabled" '1'
[ "$enabled" -gt 0 ] && {
echo "$device none swap ${noauto}sw 0 0" >> /tmp/fstab
}
}
do_unmount() {
local cfg="$1"
config_get target "$cfg" target
[ -n "$target" ] || return 0
config_get_bool enabled "$cfg" "enabled" '1'
[ "$enabled" -gt 0 ] && {
umount $target
}
}
do_swapoff() {
local cfg="$1"
config_get device "$cfg" device
[ -n "$device" ] || return 0
config_get_bool enabled "$cfg" "enabled" '1'
[ "$enabled" -gt 0 ] && type swapoff >/dev/null && {
swapoff $device
}
}
start() {
sleep 10
config_load fstab
echo '# WARNING: this is an auto generated file, please use uci to set static filesystems' > /tmp/fstab
config_foreach do_mount mount
config_foreach do_swapon swap
mount -a
[ -x /sbin/swapon ] && swapon -a
}
stop() {
config_load fstab
config_foreach do_unmount mount
config_foreach do_swapoff swap
[ -x /sbin/swapoff ] && swapoff -a
}root@OpenWrt:/tmp# cat fstab
# WARNING: this is an auto generated file, please use uci to set static filesystems
/dev/scsi/host0/bus0/target0/lun0/part2 /hdd ext3 rw,noatime 0 0
/dev/scsi/host0/bus0/target0/lun0/part1 none swap sw 0 0