Linux Cannot access /dev/hda ?

Discussion in 'Software' started by Tomm, 31 Jan 2005.

  1. Tomm

    Tomm I also ride trials :¬)

    Joined:
    12 Apr 2004
    Posts:
    2,249
    Likes Received:
    0
    Just installed Fedora FC3, and keep getting thise error. As far as I can tell, everything is working (installed programs, internet etc), but I can't see any of my partitions on my hard drive. I'm a total linux noob, are these of any use?

    hda1 = windows install, ntfs
    hda2 = Fedora FC3, ext3
    hda3 = swap
    <Then there's ~80GB of (as yet) unformatted space at the end of the drive>

    Code:
    [root@localhost ~]# mount
    /dev/hda2 on / type ext3 (rw)
    none on /proc type proc (rw)
    none on /sys type sysfs (rw)
    none on /dev/pts type devpts (rw,gid=5,mode=620)
    usbfs on /proc/bus/usb type usbfs (rw)
    none on /dev/shm type tmpfs (rw)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
    Code:
    [root@localhost ~]# /etc/fstab
    bash: /etc/fstab: Permission denied
    
     
  2. SeT

    SeT What's a Dremel?

    Joined:
    7 Oct 2003
    Posts:
    648
    Likes Received:
    15
    odd,. I'm not sure why root would be denied permission to /etc/fstab unless that's just a badly worded error. /etc/fstab is not an executable file - just text. Try "cat /etc/fstab" and see if you get any output. As far as mounting the ntfs partition, you'll want to do:
    mkdir /mnt/windir
    mount -t ntfs /dev/hda1 /mnt/windir

    You can add a line to you fstab that will mount that partition on boot if you find out that you do have permission and that's a bad error like I'm thinking.
     
  3. trigger

    trigger Procrastinator

    Joined:
    22 Mar 2004
    Posts:
    1,097
    Likes Received:
    30
    As SeT said the permission denied error is because you are trying to execute a non executable file. So just cat-ing it should do the job. When are you getting the 'cannot access /dev/hda' error? Sounds like you may be trying to mount /dev/hda (the entire drive) rather than /dev/hdaX (a partition on the drive)...
     
  4. Tomm

    Tomm I also ride trials :¬)

    Joined:
    12 Apr 2004
    Posts:
    2,249
    Likes Received:
    0
    Thanks for the help :)

    Code:
    [root@localhost ~]# cat /etc/fstab
    # This file is edited by fstab-sync - see 'man fstab-sync' for details
    LABEL=/                 /                       ext3    defaults        1 1
    none                    /dev/pts                devpts  gid=5,mode=620  0 0
    none                    /dev/shm                tmpfs   defaults        0 0
    none                    /proc                   proc    defaults        0 0
    none                    /sys                    sysfs   defaults        0 0
    LABEL=SWAP-hda3         swap                    swap    defaults        0 0
    /dev/hdc                /media/cdrecorder       auto    pamconsole,fscontext=system_u:object_r:removable_t,ro,exec,noauto,managed 0 0
    I get the error message when I try to browse to /dev/hda or hda1, hda2 etc. As I said, I'm a linux noob, so I don't really know if I should be doing that. I wasn't lieing when I said I had problems with linux & partitioning :sigh:

    EDIT: This also seems odd to me
    Code:
    [root@localhost ~]# mkdir /mnt/windir
    [root@localhost ~]# mount -t ntfs /dev/hda1 mnt/windir
    mount: mount point mnt/windir does not exist
    Also, a quick one: How do I change from GNOME to KDE?
     
  5. trigger

    trigger Procrastinator

    Joined:
    22 Mar 2004
    Posts:
    1,097
    Likes Received:
    30
    As you seems to have found out now, in Linux you have to mount a partition before you can use it. The best way to think of it is that /dev/hda1 is the physical drive, and then to use it, you need to mount it in /mnt/whatever.

    Oh and the reason your mount command didn't work is you need an extra '/', try this:

    Code:
    [root@localhost ~]# mount -t ntfs /dev/hda1 /mnt/windir
    Then you should be able to access your Windows stuff from /mnt/windir.
     
  6. Uncle Psychosis

    Uncle Psychosis Classically Trained

    Joined:
    27 Jul 2003
    Posts:
    1,694
    Likes Received:
    9
    your fstab doesn't seem to contain any references to your /dev/hdaX things. You probably need to alter it (probably best to read the man pages or google, its a bit complicated to explain).

    If you want to mount /dev/hda2 you need to

    a)create somewhere for it mount
    b)mount it (you can alter fstab to mount it automatically)

    So, you could try

    #mkdir /mnt/GIVE_IT_A_NAME
    #mount -t ext3 /dev/hda2 /mnt/GIVE_IT_A_NAME

    then you should be able to

    #cd /mnt/GIVE_IT_A_NAME

    and browse normally. Note that normal users won't be able to access these drives unless you give them permission. That's what fstab is for!!

    Here is mine:

    Code:
    # <fs>                  <mountpoint>    <type>          <opts>                  <dump/pass>
    
    # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
    /dev/hda2               /boot           ext2            noauto,noatime          1 1
    /dev/hda4               /               reiserfs        noatime                 0 0
    /dev/hda3               none            swap            sw                      0 0
    #/dev/cdroms/cdrom0     /mnt/cdrom      iso9660         noauto,ro               0 0
    /dev/cdrom              /mnt/dvd        iso9660         noauto,ro,user          0 0
    /dev/cdroms/cdrom1      /mnt/cdrom      iso9660         noauto,ro,user          0 0
    
    /dev/hda1               /mnt/c          vfat            noatime,user,uid=1000,gid=100 0 0
    /dev/hdb1               /mnt/d          vfat            noatime,user,uid=1000,gid=100 0 0
    # NOTE: The next line is critical for boot!
    none                    /proc           proc            defaults                0 0
    
    # glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
    # POSIX shared memory (shm_open, shm_unlink).
    # (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
    #  use almost no memory if not populated with files)
    # Adding the following line to /etc/fstab should take care of this:
    
    none                    /dev/shm        tmpfs           defaults                0 0
    /dev/fd0        /mnt/floppy      ext2    noauto          0 0
    HTH

    Oh, and changing from Gnome to KDE can be fairly trivial, or a bit more complicated. If you are using GDM as your login manager then on the "Session" option you should be able to select KDE...

    Sam
     
  7. Tomm

    Tomm I also ride trials :¬)

    Joined:
    12 Apr 2004
    Posts:
    2,249
    Likes Received:
    0
    Sorry, I don't understand that :blush:

    @Trigger:
    Code:
    [root@localhost ~]# mount -t ntfs /dev/hda1 /mnt/windir
    mount: fs type ntfs not supported by kernel
    :sigh:
     
  8. trigger

    trigger Procrastinator

    Joined:
    22 Mar 2004
    Posts:
    1,097
    Likes Received:
    30
    Hmm, that good be bad news. Try using 'auto' instead of 'ntfs' in that mount command. If that doesn't work, it may be that you don't have NTFS support in your Kernel, alas I haven't used FC3, so couldn't confirm this.

    If that is the case, you will need to recompile your kernel. Which can be a bit of a slog but you get a great sense of achivement when done! Good luck!
     
  9. Go4t

    Go4t i

    Joined:
    13 Dec 2003
    Posts:
    939
    Likes Received:
    1
    iirc with fedora/redhat there is a update/patching thing kinda like yast so there may be an ntfs support patch for the kernel
     
  10. Uncle Psychosis

    Uncle Psychosis Classically Trained

    Joined:
    27 Jul 2003
    Posts:
    1,694
    Likes Received:
    9
    The kernel probably won't need to be patched, it just will need ntfs modules compiled. Linux doesn't have very good ntfs support to be honest, and trying to write to an ntfs partition is not a good idea at all. Better to use fat32 if possible.

    Tom, what I mean about GDM is the graphical login manager for Gnome. How do you login to your account at the moment? Does x start up automatically and you have a graphical login screen or do you just get a command prompt and then you type startx? If its graphical, there should be a "session" button. If you have kde installed then it should be available.

    Cheers

    Sam
     
  11. Tomm

    Tomm I also ride trials :¬)

    Joined:
    12 Apr 2004
    Posts:
    2,249
    Likes Received:
    0
    Thanks, I'm on KDE now, which is slightly more familiar to me, always good :)

    The thing is with ntfs, it works fine with knoppix. I could read all the files without even mounting anything manually. That was on version 2.4 of the kernel too, whereas this is 2.6 I think. So I'm sure it must have ntfs support. I am going to have a fat32 partition at the end of the drive (for media stuff), so that's cool. I don't need to access the windows partition from linux, but I know that I should be able to. It's a principle sort of thing...

    @ Trigger - I still get the same message using the "auto" switch :(

    I need to format the existing space at the end of the drive into FAT32, and I'll see if I have more luck mounting that. Windows won't format into FAT32 (it'll only do NTFS) and fdisk won't format it into a version that windows understands. I know I could use partition magic from within windows, but that doesn't understand ext3 partitions and always crashes when I try and start it. So I need a small program that can format empty space into FAT32. Any ideas?
     
  12. Uncle Psychosis

    Uncle Psychosis Classically Trained

    Joined:
    27 Jul 2003
    Posts:
    1,694
    Likes Received:
    9
    What version of windows are you using? I'm sure you can format things into fat32 because I've done it before. Anyway, can you not just use fdisk from within your linux install? That will definitely let you do it.

    As for ntfs support, you need to make sure the kernel has had the right modules built into it. The option will be there but not included by default in order to keep the kernel size down. You will need to find a guide to how to recompile your kernel---it's easier than it sounds.

    If you want to look at what options the kernel has then you can do this (which will also be the first few steps in compiling the kernel. Be careful not to save anything unless you know what you are doing)

    #cd /usr/src/linux
    #make menuconfig

    The ntfs thing will be hidden in there somewhere- I think "file system support" is one of the top level menus...

    Sam

    Sam
     
  13. Tomm

    Tomm I also ride trials :¬)

    Joined:
    12 Apr 2004
    Posts:
    2,249
    Likes Received:
    0
    WinXP Pro. When I click on the D: drive in explorer, it tells me it needs formatting (even though it IS formatted into fat32 via fdisk). Hennyway, when I say "yes, i'll format it", it only gives the option for ntfs.
    Doesn't work :(
     
  14. Uncle Psychosis

    Uncle Psychosis Classically Trained

    Joined:
    27 Jul 2003
    Posts:
    1,694
    Likes Received:
    9
  15. Uncle Psychosis

    Uncle Psychosis Classically Trained

    Joined:
    27 Jul 2003
    Posts:
    1,694
    Likes Received:
    9
  16. trigger

    trigger Procrastinator

    Joined:
    22 Mar 2004
    Posts:
    1,097
    Likes Received:
    30
    According to wikipedia, FC3 doesn't come with NTFS enabled

    As Uncle said, you can download an RPM for it.

    To find out which RPM you want to download, check your kernel version with this:

    Code:
    $ uname -r
     
  17. Tomm

    Tomm I also ride trials :¬)

    Joined:
    12 Apr 2004
    Posts:
    2,249
    Likes Received:
    0
    WindowsXP won't partition FAT32 larger than 32GB, and partition magic won't work on account of the linux partitions :sigh:
     
  18. Uncle Psychosis

    Uncle Psychosis Classically Trained

    Joined:
    27 Jul 2003
    Posts:
    1,694
    Likes Received:
    9
    Use fdisk from within fedora?

    Sam
     
  19. trigger

    trigger Procrastinator

    Joined:
    22 Mar 2004
    Posts:
    1,097
    Likes Received:
    30
    I fear fdisk will only create the partition; to format it you want something like:

    Code:
    $ mkfs -t vfat -F 32 /dev/hdaX
     
  20. Uncle Psychosis

    Uncle Psychosis Classically Trained

    Joined:
    27 Jul 2003
    Posts:
    1,694
    Likes Received:
    9
    Ahh, good point. It's been a while :D

    Sam
     
Tags:

Share This Page