Find the answer to your Linux question:
Results 1 to 7 of 7
I am trying to mount a hard drive it shows up as /dev/sda1 I can click it and mount it via the GUI but I need it mounted for this ...
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    11

    [SOLVED] Hard Drive Won't Mount

    I am trying to mount a hard drive it shows up as /dev/sda1

    I can click it and mount it via the GUI but I need it mounted for this script and do not want to have an extra step of doing it manually

    I have tried (also tried sda vs sda1, no differance)
    sudo mount /dev/sda1
    sudo mount -t ntfs/dev/sda1
    sudo mount -t ntfs-3g/dev/sda1

    I know the drive is sda the only partition on it being sda1, but either I get an error saying it couldn't be found or I simply get no response depending on how I alter the code

    Thanks for you help and suggestions

    Oh also the drive shows hpfs/ntfs 0x07 in the disk utility

  2. #2
    Linux Newbie
    Join Date
    Mar 2010
    Posts
    121
    Try this command:

    Code:
    man man
    Then this:

    Code:
    man mount

    P.S. This may come off as sarcastic to some - it's merely intended to be succinct.

  3. #3
    Just Joined!
    Join Date
    Jul 2010
    Posts
    11
    Quote Originally Posted by JohnGraham View Post
    Try this command:

    Code:
    man man
    Then this:

    Code:
    man mount

    P.S. This may come off as sarcastic to some - it's merely intended to be succinct.
    read the information on mount in there
    tried -U and the uuid for the drive which I have being saved as a variable
    tried -a from what I understand is supposed to mount all partitions available

    the main problem is that I do not know all of the syntax for bash yet as this is my first bash script

    I do not mean to sound like one of the people who expect to post a question and have other people write the code fro them piece by piece, I am just new to this and I got stuck here at the end on the UUID (other post) and this mounting problem. I never expected mount to become and issue as it seems pretty straight forward, but as I keep getting errors something has to be wrong

  4. #4
    Linux Newbie
    Join Date
    Mar 2010
    Posts
    121
    Sorry, I thought it'd be clearer on the man page - looking at it, the one for mount is quite complicated, they're usually more straightforward!

    Anyway, the major thing you seem to be missing is that you need somewhere to mount a file system - you're specifying what you want to mount, but not where to mount it. For example, if you have a directory (an empty directory) at /mnt/sda1-mount/, you can mount /dev/sda1 there with the following command:

    Code:
    sudo mount /dev/sda1 /mnt/sda1-mount/
    You'd only omit the directory if /dev/sda1 is in your fstab (see "man fstab").

    If it gives you an error about "unknown filesystem type" or something like that, that's when you want to start giving it "-t ntfs" and such.

  5. #5
    Just Joined!
    Join Date
    Jul 2010
    Posts
    11
    Quote Originally Posted by JohnGraham View Post
    Sorry, I thought it'd be clearer on the man page - looking at it, the one for mount is quite complicated, they're usually more straightforward!

    Anyway, the major thing you seem to be missing is that you need somewhere to mount a file system - you're specifying what you want to mount, but not where to mount it. For example, if you have a directory (an empty directory) at /mnt/sda1-mount/, you can mount /dev/sda1 there with the following command:

    Code:
    sudo mount /dev/sda1 /mnt/sda1-mount/
    You'd only omit the directory if /dev/sda1 is in your fstab (see "man fstab").

    If it gives you an error about "unknown filesystem type" or something like that, that's when you want to start giving it "-t ntfs" and such.
    I tried this and a couple of variations on the idea, I always gt this error
    fuse: failed to access mountpoint because /mnt/sda1-mount: No suce file or directory

    I have tried to mount to /media/... as well

  6. #6
    Linux Newbie theNbomr's Avatar
    Join Date
    May 2007
    Location
    BC Canada
    Posts
    150
    You must first create the mountpoint directory. In your case, you tried to use '/mnt/sda1-mount', and that directory does not exist. Choose a mountpoint that suits your requirements, create that mountpoint directory (a one-time-only command), and then mount the drive on that directory. Thereafter, you can access the filesystem of the mounted drive with the root of the partition at the mountpoint.
    Code:
    #
    #  Make a mountpoint
    mkdir -p /some/directory/of/your/choice
    #
    # Mount the NTFS partition at the created mountpoint
    mount -t ntfs /dev/sda1 /some/directory/of/your/choice
    #
    # See what is in the NTFS partition root
    ls -las /some/directory/of/your/choice
    Read the ntfs section of the mount manpage for more details. Your distribution may use the ntfs-3g filesystem type. If so, use that instead of ntfs.

    --- rod.
    Last edited by theNbomr; 07-26-2010 at 03:09 PM.
    Stuff happens. Then stays happened.

  7. #7
    Just Joined!
    Join Date
    Jul 2010
    Posts
    11
    Problem Solved, Thank You

Posting Permissions

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