Installing And Sharing HDD Partition via SSH
Ever wondered how to install and share your new hard drive with ssh over the internet? Here’s how to do it on Ubuntu Server 10.04 LTS.
- Format the drive to FAT32 or NTSC if you’re going to use it for files larger than 4GB.
- Connect your hard drive to the server
don’t forget to turn it off first when installing an internal drive, if it’s a usb just plug it in. - Next we need to check which device is the new hdd.
sudo fdisk -l
Disk /dev/sda: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000d57dDevice Boot Start End Blocks Id System
/dev/sda1 * 1 9921 79687680 83 Linux
/dev/sda2 9921 10012 728065 5 Extended
/dev/sda5 9921 10012 728064 82 Linux swap / SolarisDisk /dev/sdc: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000413e2Device Boot Start End Blocks Id System
/dev/sdc1 1 182401 1465136001 7 HPFS/NTFS
In the list above we see that the device /dev/sdc1 is the one we want to mount.
Now that we know which device we’re going to use, we need to create the directory (mount location). After that we’re going to mount the /dev/sdc to that location. So when we enter the newly created dir it’s going to have the contents of the drive.
sudo mkdir /mnt/wd15
sudo vi /etc/fstabadd the following line in the fstab file
/dev/sdc1 /mnt/wd15 ntfs-3g defaults,locale=en_US.utf8 0 0
sudo mount /mnt/wd15
Now we’ve mounted /dev/sdc1 (our external drive) to /mnt/wd15. Every time system starts up the hdd will auto mount.
You’re about to be done, just mount the drive on your ubuntu desktop.
Just go to PLACES -> CONNECT TO SERVER -> service type=ssh, server=<<your_ip>>,port=22(default),folder=/mnt/wd15, name=<<username>>,BookmarkName=<<name_of_the_drive>>(optional)
Trouble shooting:
If you get the shared key error just delete it from ~/.ssh/known_hosts on the client machine or delete the file itself.