Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: How do I mount an external hard-drive via SSH?

  1. #1
    Join Date
    Mar 2008
    Location
    Philadelphia, PA
    Beans
    123

    How do I mount an external hard-drive via SSH?

    I'm running Ubuntu Server w/ xubuntu xwindows at home.
    I was fooling around via SSH and had to restart the system using:
    sudo shutdown -r now
    after the system reboot, my external hard drive is no longer available (I'm guessing because I'm no longer logged into xwindows - it usually mounts automatically). Is there a way I can do this remotely? Or a way I can set the external drive to mount automatically on restart? Thanks!

  2. #2
    Join Date
    Nov 2007
    Beans
    449
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: How do I mount an external hard-drive via SSH?

    Yes, to make it mount automatically you can add a line to your fstab. To mount it via ssh (assuming you are connected via ssh) do this
    Code:
    sudo mount /dev/usb /media/disk
    you might have to use /dev/hdb1 and you might have to create /media/disk first
    quidquid Latine dictum sit altum videtur

  3. #3
    Join Date
    Mar 2008
    Location
    Philadelphia, PA
    Beans
    123

    Re: How do I mount an external hard-drive via SSH?

    how do I "create" /media/disk

    when I startx and login it mounts to /media/Venus/ automatically


    but when remotely I type

    root@xxxx:~# sudo mount /dev/usb /media/Venus
    mount: mount point /media/Venus does not exist

  4. #4
    Join Date
    Jul 2005
    Beans
    4

    Re: How do I mount an external hard-drive via SSH?

    Just a very simple:

    Code:
    mkdir /media/Venus/
    Which will make the directory.

  5. #5
    Join Date
    Mar 2008
    Location
    Philadelphia, PA
    Beans
    123

    Re: How do I mount an external hard-drive via SSH?

    Quote Originally Posted by iDaniel View Post
    Just a very simple:

    Code:
    mkdir /media/Venus/
    Which will make the directory.
    root@bxxxxx:~# sudo mount /dev/usb /media/Venus
    mount: special device /dev/usb does not exist

  6. #6
    Join Date
    Jul 2006
    Location
    Hertfordshire
    Beans
    454
    Distro
    Kubuntu 9.04 Jaunty Jackalope

    Re: How do I mount an external hard-drive via SSH?

    If you are trying to mount the external drive the same way as when you normally log in through the graphical interface (e.g. it only mounts when plugged in) you can use:

    gnome-mount -n

    It won't look like it's done much, but this should detect your external drive and mount it to something like /media/usbdisk (check the /media directory afterwards).

    The "-n" basically tells it not to try and pop up a graphical dialog if theres a problem, which is a good idea if you've SSH'd remotely.

    I've had reports that this hasn't worked for some people, I'm not sure why but it's worked for me every time.

  7. #7
    Join Date
    Mar 2008
    Location
    Philadelphia, PA
    Beans
    123

    Re: How do I mount an external hard-drive via SSH?

    that gives me:

    root@xxxxx:~# gnome-mount -n
    X11 connection rejected because of wrong authentication.
    Use --hal-udi, --device or --pseudonym to specify volume


    I won't be home (where the server is) for a few days, and I'd really like to get this mounted so I can access certain files that are on the drive. Thanks for all the help thus far.

  8. #8
    Join Date
    Nov 2007
    Location
    NC, USA
    Beans
    829
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How do I mount an external hard-drive via SSH?

    Run

    Code:
    fdisk -l
    As in lowercase L. This will show you all of the available drives attached to the machine. Assuming you only have one HD and the external, the external would probably be /dev/sdb1. So here's how the command would work.

    Code:
    sudo mount -t ntfs-3g /dev/sdb1 /media/Venus
    Assuming that the filesystem type is NTFS. If it's FAT32, swap out ntfs-3g for vfat.

    To get it to start automatically, enter this into /etc/fstab.

    Code:
    /dev/sdb1 /media/Venus ntfs 0 1

    Again swap out ntfs with vfat if the filesystem is FAT.
    Linux User #460341 || Ubuntu User #19510 || Unanswered Posts Team

  9. #9
    Join Date
    Mar 2008
    Location
    Philadelphia, PA
    Beans
    123

    Re: How do I mount an external hard-drive via SSH?

    thanks. here's what's happening now:

    root@xxxxx:~# fdisk -l

    Disk /dev/sda: 80.0 GB, 80000000000 bytes
    255 heads, 63 sectors/track, 9726 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00000080

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 1216 9767488+ 83 Linux
    /dev/sda2 1217 9483 66404677+ 83 Linux
    /dev/sda3 9484 9726 1951897+ 5 Extended
    /dev/sda5 9484 9726 1951866 82 Linux swap / Solaris

    Disk /dev/sdb: 750.1 GB, 750156374016 bytes
    255 heads, 63 sectors/track, 91201 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x7259143f

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 91201 732572001 7 HPFS/NTFS



    looks like you were right about /dev/sdb1 (thanks), but now when I go onto the next step:

    root@xxxxx:~# sudo mount -t ntfs-3g /dev/sdb1 /media/Venus
    fuse: failed to access mountpoint /media/Venus: No such file or directory


    any suggestions?

  10. #10
    Join Date
    Mar 2008
    Location
    Philadelphia, PA
    Beans
    123

    Re: How do I mount an external hard-drive via SSH?

    nevermind! figured it out through common sense - just had to

    mkdir /media/Venus/

    thanks for all your help - much appreciated.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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