Just a thought

Archive for May 1st, 2009

Problems mounting NTFS drive in Ubuntu

Posted by stringofthoughts on May 1, 2009

Most of the time ubuntu mounts the drive just by a mouse click but sometime the NTFS drives give error something like

$MFTMirr does not match $MFT(record3). Failed to mount ‘/dev/sda1’: Input/output error NTFS is either inconsistent, or there is a hardware fault, or it’s softRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows then reboot into Windows twice. The usage of the /f parameter is very important! If the device is SoftRAID/FakeRAID then first activate it and mount a different device under the /dev/mapper directory, (e.g. /dev/mapper/nvidia_eahaabcc1). Please see the ‘dmraid’ documentation for more details

This error is the result of improper shutdown or power off in the middle of windows startup. Simple put you need to run a check disk on the drive and everything will go away.  So if it’s a dual boot machine and you ‘ve windows boot into windows and open command prompt (Start -> Run -> {type} cmd and enter). let’s say the ntfs drive is F: then on the command prompt

C:\>chkdsk f: /f

After this boot into ubuntu and it’ll mount ntfs drives without a problem. The situation gets tricky if you ‘ve removed windows or windows got corrupted and you need to access drive for important file. For such situations you need to install ntfs tools in ubuntu

$ sudo apt-get install ntfsprogs

Ntfsprogs is very nice package containing tools to handle issues with ntfs drives in Linux. Lets say your troubled ntfs drive is /dev/sda1 . to fix the problem

$ sudo ntfsfix /dev/sda1

This should fix the problem. You need to reboot after this step.

Sometimes this also doesn’t work. For such situations you should keep a copy of Hiren’s Boot CD or System rescue CD these live CDs are rescue CDs and contains chkdsk tool, comes really handy in times like this.

I hope these solutions works  for you 🙂

Advertisements

Posted in Linux, tips 'n tricks | 1 Comment »

NTLDR missing

Posted by stringofthoughts on May 1, 2009

NTLDR missing is one error message that scares most windows users to death. Usual thought is that system is gone. It’s a very simple error and can be fixed very easily. NTLDR (NT Loder ) is the boot loader for windows just like grub or lilo in Linux. NTLDR missing error doesn’t mean that your system is gone it simply tells you that bootloder is missing or corrupted. Here is what you can do to correct this. You ‘ll need a bootable windows CD.

  • Insert  the Windows CD and start the computer. (Make sure CD/DVD drive is the primary boot device)
  • At the Welcome to Setup screen , press R to start recovery console.
  • Type the number corresponding to the Windows installation you wish to repair (usually 1, if you have only one installed copy) and press Enter.
  • When prompted, type the administrator password and press Enter.
  • Use map command to find out the drive letter of your CD/DVD drive, say it gives I:
  • From the command prompt
    COPY I:\I386\NTLDR C:\
    COPY I:\I386\NTDETECT.COM C:\
  • Remove the Windows XP CD from the drive and restart the computer.

That’s all. Everything is fixed and the way it was before.  Things get complicated when you don’t ‘ve any recovery disk. You can simply copy these files from another computer which has same setup and OS as yours to C drive. Using Linux live CD is the easiest method.

  • Boot from Linux live CD in another computer having same OS has yours ( like if you have winXP boot into a WinXP computer)
  • Copy the file ntldr and NTDETECT.COM to USB drive.
  • Boot from Linux live CD into your computer
  • Mount your C drive and copy these files to C drive.
  • Restart the computer

This should work. get a rescue disk for next time or better learn and switch to Linux 😀

Posted in Linux, tips 'n tricks | Leave a Comment »

Mounting windows drives in Ubuntu

Posted by stringofthoughts on May 1, 2009

How to mount windows drives in ubuntu is still a major issue for new user. I’ve written a script to auto mount drives at startup. No need for you to go change fstab and get confused 🙂 . Ubuntu has made mounting drives very easy. You just need to click on the drive and it’s mounted 🙂 pretty easy huh. I bet windows fans coming to Linux would love it. Despite all this sometime you might need to mount manually. FAT32 drives mount flawlessly all the time but NTFS drives gives error if it’s a dual boot machine which powered off or reboot to Linux in the middle of either windows start up or windows shutdown.

Couple of things you need to know when you mount manually on ubuntu. There is default mount folder in ubuntu /media. /mnt is another one usually used for manual mounting. There is not rule about using /mnt only for manual mount you can mount anywhere. Make a folder /win_drives or /home/user/win_drives anywhere you want you can mount. The catch here is with the nice click mount/umount utility provided by ubuntu. If you mount a drive manually it can be unmounted only manually. If you mount your drives anywhere other than /media like in /mnt or /win_drives it won’t show up in places column in file manager.  Although it show up in places if your mount point is in your home directory.

So the smart way to mount a drive would be to keep it on places in file manager and keep the click mount/umount working on manually mounted drives.  So there are two things you need to do. Mount a drive and update /media/.hal-mtab (entry in this file allows you to use click mount/umount utility )

We are gonna use /dev/sda1 as drive and /media/drive as mount point

Mount Fat32 drives

$ sudo mount -t vfat /dev/sda1 /media/drive -o defaults

Now update /media/.hal-mtab

$ sudo echo “/dev/sda1    1000    0    vfat    nosuid,nodev,uhelper=hal,shortname=mixed,uid=1000,utf8,umask=077,exec,flush    /media/drive” >> /media/.hal-mtab

Mounting NTFS drives

$ sudo mount -t ntfs-3g /dev/sda1 /media/.hal-mtab

Now update /media/.hal-mtab

$ sudo echo “$i    1000    0    ntfs-3g    nosuid,nodev,uhelper=hal,locale=en_IN,exec    /media/”$myLabel”” >> /media/.hal-mtab


If you simple wanna mount drive and don’t care about click mount/umount then

$ sudo mount -t vfat /dev/sda1 /media/win_drive

$ sudo mount -t ntfs-3g /dev/sda1 /media/win_drive

Posted in Linux | Leave a Comment »