Filesystem corruption on Dreamplug when used as router
it's been two days (and nights) I'm trying to set up my dreamplug (that was working fine up to now) to act as a router; basically I'd like to connect my windows PC to eth0 being able to see the SAMBA share I created on the USB disk connected to the Dreamplug. I'd also like to be able to connect to the Internet from the above Windows PC connected to eth0
eth0: connected to my Windows PC wired
eth1: connected to the Internet and gets the IP address from my router via DHCP
I'm using Debian Wheezy.
Following some posts around I modified /etc/network/interfaces, initSetup.sh, sysctl.conf as follow:
iface lo inet loopback
iface eth0 inet static
iface eth1 inet dhcp
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
/etc/init.d/udhcpd start # start DHCP server
# Set leds
echo 1 > `eval ls /sys/class/leds/guruplug\:green\:wmode/brightness`
echo 0 > `eval ls /sys/class/leds/guruplug\:red\:wmode/brightness`
I also installed bind9 to share the DNS with my Windows PC connected to eth0 (I also removed it just to check if the problem lied there)
opt lease 86400
opt router 192.168.5.1
opt subnet 255.255.255.0
opt dns 192.168.5.1
opt domain localdomain
eth1 works fine, gets the IP address from my ISP Router and connects to the Internet
Whenever I connect a LAN cable to eth0 (my Windows PC on the other side):
a) the PC does not get an IP address no matter how many times I restart udhcpd or the networking service
b) filesystem gets immediately corrupted, I cannot access files in etc/ and in many other locations, I have to take out the Dreamplug internal SD, insert it in my Ubuntu PC and run e2fsck in order to fix all the problems it finds. If I don't do ths the Dreamplug is not able to restart. the problems e2fsck finds are (just a few lines):
I'm really stuck here, anybody has any idea about why it is happening and how I can fix the problem and configure the Dreamplug as a router?
e2fsck 1.41.11 (14-Mar-2010)
e2fsck: Group descriptors look bad... trying backup blocks...
Superblock needs_recovery flag is clear, but journal has data.
Recovery flag not set in backup superblock, so running journal anyway.
dp-rootfs: recovering journal
Resize inode not valid. Recreate<y>? yes
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong for group #0 (31778, counted=31779).
Free blocks count wrong for group #1 (31428, counted=30973).
Free blocks count wrong for group #2 (31359, counted=30947).
Free blocks count wrong for group #4 (21905, counted=19898).
Free blocks count wrong for group #5 (22939, counted=9928).
Free blocks count wrong for group #6 (25060, counted=28039).
Thank you very much in advance for your help!!