Find the answer to your Linux question:
Results 1 to 6 of 6
Hi all! i am in deep trouble!.................i have been using fedora core 3 laptop with an external usbhd having ext2 fs.........it was working fine. however i accidentally plugged in the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2005
    Posts
    3

    ext2 fs usbhd on windows!


    Hi all!
    i am in deep trouble!.................i have been using fedora core 3 laptop with an external usbhd having ext2 fs.........it was working fine. however i accidentally plugged in the usbhd into my laptop while it was in windows partition. Now windows was trying to automatically detect the usbhd. It must have done something nasty, as i now i cannot mount my usbhd inside fedora!......................if i type "mount" in linux, it shows usbhd listed as having filesystem "usbfs".....................did windows cahnge the fs to "usbfs"? does that mean i lose all my data????!! is there any way to revert to ext2 without loss of data? has anyone faced such a problem before?
    any help will be deeply appreciated!
    thanks
    abhishek.

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Are you sure that usbfs is really mounted from the USB disk? usbfs should only ever be mounted on /proc/bus/usb, since it's just a pseudo-filesystem that reflects information about the USB device tree to kernel space.

    What happens if you try to mount the USB HD manually. That is, with the full device name and filesystem type given to mount?

  3. #3
    Just Joined!
    Join Date
    Jul 2005
    Posts
    3
    Ya, I am sorry for using loose english in my last posting. Let me be more precise. when i type "mount" it shows (among other entries)
    usbfs on /proc/bus/usb type usbfs (rw)
    that is normal.................if i check the file /proc/bus/usb/devices it list basic info about my usb hard disk like Iomega, size etc as it normally always does.
    I have always had an entry in my /etc/fstab like follows

    /dev/sda1 /mnt/usbhd auto defaults 0 0

    now when i type mount -t ext2 /dev/sda1 /mnt/usbhd i get the following error msg...
    mount: wrong fs type, bad option, bad superblock on /dev/sda1, or too many mounted filesystems................
    If i try mount -t usbfs /dev/sda1 /mnt/usbhd................
    it apparently mounts to usb hard disk, but when i try to change directory to
    /mnt/usbhd it has none of my data but the same contents as the directory /proc/bus/usb...................
    it has 3 directories 001 002 003 and a file "devices"
    however, even now when i try to use something like "df" to check the disk usage of the various partitions, /mnt/usbhd is NOT mentioned.
    the use of "mount" at this stage shows
    /dev/sda1 on /mnt/usbhd type usbfs (rw)....................
    this is bad! It used to show ext2 as the mounted filesystem earlier!
    This is a very bitter blow for me......................i will loose all of my 100GB of data!
    help!
    abhishek.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Well, mounting it as a usbfs mount just means that it won't even touch your hard drive. The usbfs filesystem is a pseudo-filesystem, like proc or sysfs, that doesn't even touch the device you give it. It just generates virtual files on the fly.

    However, it's still weird that you can't mount it as ext2, of course. First of all, check what `fdisk -l /dev/sda' says, so that Windows hasn't just erased the partition table or anything. If it hasn't, try fsck'ing /dev/sda1, like this:
    Code:
    fsck.ext2 -fv -C 0 /dev/sda1

  6. #5
    Just Joined!
    Join Date
    Jul 2005
    Posts
    3
    Hi man!
    the problem is solved!!! phewwwwwwww!
    here is what was wrong.....................apparently /dev/sda1 was not umounted properly when I had the fisco of plugging it on windows(i had pulled out the usb cable as the windows had hanged)...........................Now since in my /etc/fstab the last column for /dev/sda1 is "0", this means the filesystem was NOT being checked on boot time........................I changed that to "3" (3rd in order after root filesystem etc)...............this time when i rebooted the machine, it prompted me by saying that /dev/sda1 was NOT unmounted properly and that I shud run "fsck" manually..................this did. It took ~1 hour for me to type "yes" to every prompting by fsck given the fact that the disk had 100GB of data. (actually i just stuck a pencil in the "y" key of my keyboard ). This worked...................the machine was rebooted and now the disk runs as good as new and all the data is intact...............
    The lesson that i learned from this is to always enable filesytem checking in the /etc/fstab....................so that even if the disk is not unmounted properly, it will be fixed automatically on next reboot ...................
    Thanks a lot for your support man!
    U dont know how relieved I am!
    cheers!
    abhishek.

  7. #6
    Linux User twoHats's Avatar
    Join Date
    Jan 2005
    Location
    NH, USA
    Posts
    280

    Pencil in kbd

    Thanks for the best laugh i have had in months - the pencil in the kbd thing is genius for those times when you don't want to sit an press "y" .

    There is a switch for fsck that will blow past requests for confirmation..


    fsck -a

    or e2fsck -p

    will do the fix with no prompting. The first use is not safe for non ext2 file systems.

    I still like the pencil tho!
    - Clouds don't crash - Bertrand Meyer

    registered Linux user 393557

    finally - hw to brag about - but next year it will look pitifully quaint:
    Athlon64 X2 3800 - 1G PC3200 - 250G SATA - ati radeon x300
    circa 2006

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •