User Tools

Site Tools


howto:perform_disk_scan

Filesystem Errors: Need to Perform Disk Scan

When a Linux system is not properly shutdown, flushing the cache before umounting drives, filesystem errors will be resulted.

In the worst case, you won't be able to bootup next time if some important files are corrupted. Or the system may refuse to mount a SD card or USB drive. Typically, when you see an error “You do not have permission to …” and yet you found that even as root the same error persist, then most likely you have a filesystem error somewhere.

In a full-pledged Linux distribution, normally during the bootup process, the boot script will run a filesystem check before mounting partitions, thus automatically take care of such problem. But in the default Xandros of the Eeepc, probably because to achieve fast bootup speed, this feature has been sacrificed. And so we are up to ourselves to be aware of filesystem errors and to perform disk scan when needed.



Filesystem errors may occur in 3 different locations in the default Xandros filesystem and the procedure how to deal with them (perform disk scan) are listed below:

Case 1: Perform Disk Scan for the USER partition (/dev/sda2) of the unionfs

This is the easiest case because Asus has provided a script to run disk scan on /dev/sda2 which can be accessed from the boot menu pressing F9 during bootup.

  1. Repeatedly press <F9> during bootup (after you see the Asus splash screen).
  2. Highlight Perform Disk Scan and press <Enter>

This will perform a filesystem checking on the USER partition (2nd partition) of the SSD, i.e. sda2, and then reboot.

Case 2: Perform Disk Scan for the root partition (/dev/sda1)

This is the most tedious. With the default Xandros of the Eeepc, there is no way to perform disk scan on the 1st partition of the SSD (/dev/sda1) once you have booted up because it is potentially dangerous to run a filesystem checking on a mounted partition. One way to do it is to grasp a Linux on USB, e.g. Pupeee and boot up with it.

If you don't have an USB stick at hand, then you can try to do it in rescue mode following instructions in this wiki: Perform Disk Scan on sda1.

Yet another easier way is use the initramfs image built by forum member albkwan as posted in this thread. This works exactly the same way like the Asus provided “Perform Disk Scan” option for sda2 - just bootup, press F9, then select Perform disk scan on sda1.

To install this in the Eeepc 701 models:

1) First download this initramfs-fsck-eeepc.img.gz and unzip it in /home/user.

2) Open File Manager, navigate to the folder /boot/grub and edit the file menu.lst with the default text editor. Add this new entry:

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 in /home/user.

[NB. If you have a 900 or 901 model, instead of saving into /home/user, you should save the files somewhere else because /home/user is in an USB partition sdb1. In rescue mode, USB drivers are not yet loaded. But you can follow the instructions here to mount it.]

3) Copy the files to /dev/sda1.

You can either bootup with another Linux from USB, e.g. Pupeee, or boot into rescue mode. Below are the commands for working in rescue mode.

mount /dev/sda1 /mnt-system
mount /dev/sda2 /mnt-user
cp /mnt-user/home/user/initramfs-fsck-eeepc.img /mnt-system/boot
cp /mnt-user/home/user/menu.lst /mnt-system/boot/grub
umount /mnt-system
umount /mnt-user

4) Umount the partitions, wait at least 5 sec. Then reboot by pressing [Ctrl]-[Alt]-[Del]. When you see the startup screen with the Eee PC logo, start pressing the F9 key repeatedly. This takes you to the Grub boot screen. Then select Perform Disk Scan on sda1. That's all.

For those who would like to build the initramfs image by themselves, you can refer to the DIY section in this thread: Howto: Run filesystem check on /dev/sda1

Case 3: Perform Disk Scan on USB drives

Asus has not provided any GUI tools in its tabbed menu to perform disk scan on USB drives, but fortunately this is not difficult to achieve in Linux. But you will need to type some commands in the Terminal (or you can copy and paste the commands from your browser to the terminal). The steps are as follows:

1) Open a Terminal Window.

2) Check where the USB drive is mounted and what device name it has been assigned with the df command.

3) As root user, umount the USB drive (because it is potentially dangerous to run filesystem check on a mounted partition).

4) As root user, run the e2fsck command to perform disk scan on the USB device.

Here is an example of the commands running disk scan on USB partition sdb1 mounted in /media/D::

df
umount /media/D:\
e2fsck -y /dev/sdb1 

Please note that to type D\: is a bit tedious [NB. \ represent a space.]. The best way to do this is to make use of the auto-complete feature of the BASH shell. Just type D, then press [TAB] to allow the system to auto-complete the rest for you.

You need to verify the exact device name and mount folder of your USB drive and change the above commands accordingly.



Or if you prefer a GUI solution, you can install the program gparted. It will give you a nice GUI program that allows you to do a lot of advanced tweaks with disk partitions.

Installing gparted is simple and straightforward, you just need to either add a Debian repository or Xandros repository, then run synaptic to install.

rio b and you sfr

howto/perform_disk_scan.txt · Last modified: 2012/01/27 19:21 by hello