This occured after the system hanged up during shut down and I have to push the power button to switch off the Eeepc. When I rebooted, I found that USB devices cannot be mounted. The error message is something like: "You do not have enough permissions to read /home/user/[name of USB device]". After some checking, I found that this is due to filesystem error generated when the system power off without cleanly umount both the SYSTEM partition and the USB device.
In a full-pledged Linux distribution, the system will usually run a filesystem check during bootup and will automatically take care of such problems. But in default Xandros of the Eeepc, probably because to achieve the fast bootup speed, this feature has been sacrificed and there is no way to do this even in rescue mode.
So, to offer a solution to this problem, I have build an initramfs image with the e2fsck binary and libraries required packed into it, as well as a bootup script to run file system check on /dev/sda1 automatically.
==========================================
For those who are interested, here are the easy steps how to do it. At the end, I will also list the DIY steps.
EASY STEPS
1) Download and extract initramfs-fsck-eeepc.img.gz. [EDIT 2009/8/16: Changed download link to www.mediafire.com.] Save it somewhere easily accessible in rescue mode, e.g. /home/user.
2) Edit /boot/grub/menu.lst with the default text editor, add new entry to the boot menu you will see when you press F9 during system bootup (just copy and paste the following lines) :
title Perform Disk Scan on sda1
root (0x80,0)
kernel /boot/vmlinuz-2.6.21.4-eeepc quiet rw vga=785 irqpoll i8042.noloop=1 root=/dev/sda1
initrd /boot/initramfs-fsck-eeepc.img
Then save it (Save As) again in /home/user.3) Boot into rescue mode and copy the 2 files initramfs-fsck-eeepc.img and grub menu.lst from /dev/sda2 to corresponding locations in /dev/sda1 (Read this wiki) for detailed instructions.
The source location of the files should be: /mnt-user/home/user/, and the destination locations should be:
/mnt-system/boot/initramfs-fsck-eeepc.img
/mnt-system/boot/grub/menu.lst
4) Umount the drives, wait at least 15 secs. Then reboot and press F9 during system startup and select the menu entry "Perform Disk Scan on sda1".
DIY STEPS
I assume you have considerable Linux knowledge if you are going to build it yourself, so I just listed out the commands for each step here instead of offering detailed explanations.
mkdir /boot/temp cd /boot/temp/ gunzip < ../initramfs-eeepc.img | cpio -i1) check dynamic libraries required to run e2fsck (and tune2fs if you have changed to ext3) and copy them to the folder lib/ in the new initramfs image filesystem you have unpacked:
ldd /sbin/e2fsck /sbin/tune2fs mkdir lib lib/tls cd /lib cp libext2fs.so.2 libcom_err.so.2 libblkid.so.1 libuuid.so.1 libdevmapper.so.1.02 libselinux.so.1 libsepol.so.1 ld-linux.so.2 libe2p.so.2 /boot/temp/lib/ cd /lib/tls cp libpthread.so.0 libc.so.6 libdl.so.2 /boot/temp/lib/tls/[NB. The library linux-gate.so.1 can be neglected]
2) Copy required binaries to sbin/:
- /sbin/e2fsck (to run filesystem check)
- /sbin/tune2fs (if you have changed to ext3)
- /sbin/busybox.asus (to safety reboot system)
- /sbin/scanuser.sh (script to automate filesystem scanning)
mkdir /boot/temp/sbin cd /sbin cp e2fsck tune2fs busybox.asus scanuser.sh /boot/temp/sbin cd /boot/temp/sbin mv scanuser.sh scan_system.sh kwrite scan_system.sh &Edit scan_system.sh, replace with this content [NB. Uncomment the line for /sbin/tune2fs if you have changed filesystem in sda1 to ext3]:
#!/bin/sh ln -s /proc/mounts /etc/mtab echo "Scanning system partition, please wait..." /sbin/e2fsck -c -y /dev/sda1 #/sbin/tune2fs -j /dev/sda1 echo echo "Press <ENTER> to reboot..." read REPLY echo "Rebooting..." echo umount /proc sleep 5 /sbin/busybox.asus reboot -fGive this file exec permission:
chmod +x /boot/temp/sbin/scan_system.sh3) Edit init, replace with just these few lines:
#!/bin/sh
mount -t proc proc /proc
if [ -n "$XANDROSBOOTDEBUG" ]; then
/bin/busybox sh
set -x
fi
exec /sbin/scan_system.sh
4) Re-pack the initramfs image:cd /boot/temp/ find | cpio -H newc -o | gzip -9 > ../initramfs-fsck-eeepc.img5) Continue from step 2 in EASY STEPS above.
Edited by albkwan, 16 August 2009 - 03:12 PM.











