SSHFS – a useful tool

I got my NAS up and running.

To use the files remote (via internet) as if they were on my computer, i discovered a nice tool for mounting the filesystem via terminal and ssh, so no extra configuration is needed.

Here is the link to a wiki-page:

https://wiki.archlinux.org/index.php/SSHFS

And here is my line:

sshfs -o reconnect -o sshfs_sync $myserver:/path/to/mount /local/mountpoint

The reconnect option is useful if the internet isnt THAT stable ( or youre changing locations, for example when using a notebook) and sshfs_sync enables write-sync, so that the progressbar while copying is showing whats really already written, and its not put into some buffer or something and synced in the background. For using it over the internet with my notebook its useful, because you can tell if its already done, and know whats left to copy.

So… Nice tool!

Broken HDD – mount as Readonly in fstab

As mentioned before, i have a semi-broken hdd.

When i try to read some specific files i get read-errors and it unmounts. I tried many things but i am at a loss…. for the moment. as its a fairly big hdd (3TB) and i cant backup all files at once i want to mount it readonly, for the moment, soi cant save stuff on it accidentaly.

I know its no long-term solution, but whatever – its a quick fix.

To make it mount readonly i edit the /etc/fstab.

Before that i have to find out the uuid of the hdd with:

sudo blkid

In my case its:

/dev/sdd1: UUID="46f8ba4c-c330-4b9f-8cd5-1bee9e2961d7" UUID_SUB="dcd7f171-9250-4442-b6a8-0b175475f8c3" TYPE="btrfs" PARTUUID="96b59094-606e-4b2a-875f-7471b69cf066"

Now i edit the fstab and add the following line:

UUID=46f8ba4c-c330-4b9f-8cd5-1bee9e2961d7 /media/my_mount_dir btrfs noauto,ro,users 0 0

As i dont want to have it automounted, i put in “noauto”.

At last i have to reload:

sudo mount -a

Done!