Peppermint 2 - Placing a launcher on the desktop

OK, Ill type sommat up tomorrow :slight_smile:

Ta very much, much obliged. :slight_smile:

OK, this looks more complicated than it actually is … so here goes …

I’m going to assume you username is smiler, so your home directory is /home/smiler … if it’s anything else, you’ll have to adjust a couple of things.

BTW, this will ONLY mount the “share” directory on your Linkstation … if you want to mount any others, or you don’t have a directory called “share” on your Linkstation … let me know.

Create a directory to act as the mountpoint:

sudo mkdir /media/NAS-share

Create a hidden .smbcredentials file to hold your root login and password:

gedit ~/.smbcredentials

and edit it so it reads:-

username=smiler
password=<your_password>

Mine reads:-

username=mark
password=myrootpassword

SAVE the file and exit gedit.

Now to make that file secure … by changing the owner to root, and marking it readable ONLY by root:

sudo chown root ~/.smbcredentials

then

sudo chmod 600 ~/.smbcredentials

Next you’ll need to install smbfs:

sudo apt-get install smbfs

OK, now you need to edit you fstab file, but let’s back it up first:

sudo cp -v /etc/fstab /etc/fstab.backup

expected output from that command

`/etc/fstab' -> `/etc/fstab.backup'
if it's anything else .. STOP NOW and let me know what the output was.

Open fstab for editing

sudo gedit /etc/fstab

Now add a NEW LINE at the bottom that reads:-

//AWESOME_ARCHIVE/share /media/NAS-share cifs iocharset=utf8,_netdev,credentials=/home/smiler/.smbcredentials,dir_mode=0775,uid=1000,gid=1000 0 0

SAVE the file and exit gedit.

OK, now we need to fix an issue where shutting down hangs (for about 5 mins) due to networkmanager exiting before the cifs mount is unmounted … so open /etc/init/dbus.conf for editing:

sudo gedit /etc/init/dbus.conf

Now you need to add a new section that reads:-

pre-stop script
trap “TERM signal” TERM
/bin/umount -a -t cifs -f -l
trap - TERM
end script

just above the exec line.

This is what it should look like:-

# dbus - D-Bus system message bus # # The D-Bus system message bus allows system daemons and user applications # to communicate.

description “D-Bus system message bus”

start on local-filesystems
stop on runlevel [06]

expect fork
respawn

pre-start script
mkdir -p /var/run/dbus
chown messagebus:messagebus /var/run/dbus

exec dbus-uuidgen --ensure

end script

pre-stop script
trap “TERM signal” TERM
/bin/umount -a -t cifs -f -l
trap - TERM
end script

exec dbus-daemon --system --fork --activation=upstart

post-start exec kill -USR1 1

SAVE the file and exit gedit.

Now to test … run:

sudo mount -a

If there were no error messages, you’re good to go … start VLC and you should have a drive called NAS-share in the left hand column.

if there ARE errors … let me know what they are.

Hello Mark,

Sorry but I’ve only just got on here. I don’t have a shared folder on my NAS, it just goes straight into the contents (i.e. Photos folder, Music Folder etc…)

There is a Media_Access folder which is one that was set up after making a selection through the Bufalo configuration tool. I’m guessing that might be the one to use and transfer everything into it?

Not necessary … what folders DO you have in the root of the NAS ?

As far as access by the media program is concerned:

Films
Music
MP3_Music
Photos
Videos

Are those the directories that you see when you click on the NAS-Drive icon we put on your desktop earlier ?

If so which directories would you like to be mount ? (ie. so they are accessible from application File>Open menu)

If you’ve got rid of the NAS-Drive launcher … open the pcmanfm file manager, and in the address bar enter:
smb://AWESOME_ARCHIVE
and hit enter … which directories are displayed, and which ones would you like to mount … we can do all of them if you want.

For some unknown reason I cannot get the Linkstations root directory itself to mount from fstab … which would be easier, but not a major problem ???

There are ten in total but those are the five I want to be accessable in VLC.

I Still have the NAS drive launcher on the desktop from earlier, I use that to access the stored document files etc…

OK when doing the mkdir command, change the one above to:

sudo mkdir -v /media/NAS-Films /media/NAS-Music /media/NAS-MP3_Music /media/NAS-Photos /media/NAS-Videos

and add these 5 lines to fstab instead of the one above:-

//AWESOME_ARCHIVE/Films /media/NAS-Films cifs iocharset=utf8,_netdev,credentials=/home/smiler/.smbcredentials,dir_mode=0775,uid=1000,gid=1000 0 0
//AWESOME_ARCHIVE/Music /media/NAS-Music cifs iocharset=utf8,_netdev,credentials=/home/smiler/.smbcredentials,dir_mode=0775,uid=1000,gid=1000 0 0
//AWESOME_ARCHIVE/MP3_Music /media/NAS-MP3_Music cifs iocharset=utf8,_netdev,credentials=/home/smiler/.smbcredentials,dir_mode=0775,uid=1000,gid=1000 0 0
//AWESOME_ARCHIVE/Photos /media/NAS-Photos cifs iocharset=utf8,_netdev,credentials=/home/smiler/.smbcredentials,dir_mode=0775,uid=1000,gid=1000 0 0
//AWESOME_ARCHIVE/Videos /media/NAS-Videos cifs iocharset=utf8,_netdev,credentials=/home/smiler/.smbcredentials,dir_mode=0775,uid=1000,gid=1000 0 0

I’ve only put those in “code” tags, so they keep their formatting (and don’t wrap to 2 lines on small screens), if you’re using a small screen they may appear to wrap to 2 lines in fstab … if you copy paste them, also visually check them before saving fstab.

BTW, if you want that desktop NAS-Drive icon available in the left hand column in EVERY fie manager instance … click the NAS-Drive desktop, and when pcmanfm opens the NAS drive, (in the pcmanfm window) click Bookmarks>Add to bookmarks, give it the name NAS-Drive, and click OK

You should now have a bookmark in the left-hand column of all instances of pcmanfm

You can even delete the desktop launcher if you want.

Be aware … this will NOT (on its own) make it accessible by applications such as VLC … but it is handy to have it there … saves having to keep going to the desktop if you’re already in pcmanfm :slight_smile:

I’m hitting a problem when trying to retrieve the gedit file for editing. I’m being presented with this in the terminal:

(gedit:2001): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel’, but failed: Failed to create file ‘/root/.local/share/recently-used.xbel.1I9TBW’: No such file or directory

(gedit:2001): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel’, but failed: No such file or directory

Ignore that :slight_smile: … as long as gedit opens, it’s unimportant

that warning is because you are running gedit as root … so it tries to save a file to the /root/.local/share directory … but that directory doesn’t exist by default … as I said, it’s not important.

But if it will make you feel better … you can just create that directory

sudo mkdir -pv /root/.local/share

and you won’t recieve that warning any more :slight_smile:

It looks like the root user (/root directory) doesn’t have a .local directory. Create it by running:

sudo mkdir -p /root/.local/share

Sorry SeZo … I was just adding that as an edit to my previous posting, and missed that you’d already posted it

No problem, better twice than never :slight_smile:

Right, all done with no apparent error messages.

You said I should now have the NAS files visible in the left hand column. Is that within VLC? Only I can’t seem to find them.

What is the output from:

mount

smiler@Awesome1 ~ $ mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/smiler/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=smiler)

can you run:

sudo mount -a

if there are any error, let me know what they are … if that ust dumps you at another $ prompt … run:

mount

and post back the output.

smiler@Awesome1 ~ $ sudo mount -a
[sudo] password for smiler:
smiler@Awesome1 ~ $ mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/smiler/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=smiler)
smiler@Awesome1 ~ $