The Linux Community Forum

Support => General Help & Advice => Topic started by: BkS on April 15, 2012, 01:34:34 pm

Title: Mounting hard-drives from external sources. [Solved]
Post by: BkS on April 15, 2012, 01:34:34 pm
I'm currently trying to permanently mount my NAS's 3 hard-drives to a single directory. It won't matter if the drives have different names as they'll just be for storing files anyway. I need to create symlinks, but I don't know how to do that.

Output from commands:

Code: [Select]
mount

(click to show/hide)

Code: [Select]
sudo nano /etc/fstab

(click to show/hide)


Code: [Select]
sudo fdisk -l

(click to show/hide)
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 01:46:14 pm
Bearing in mind one of the drives is only 20GB .. what do you want the mountpoints, and therefore the visible folders on the NAS to be called ?

Sommat like

Docs = 20GB
and
Main_Share = 200GB

?
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 15, 2012, 02:08:31 pm
Wallpapers = 20GB
Main Share = 200GB
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 02:27:30 pm
OK, lets create the mountpoints, and the NAS-Shares directory -

Code: [Select]
mkdir ~/NAS-Shares
sudo mkdir /mnt/NAS-20GB
sudo mkdir /mnt/NAS-200GB

OK, now for the symlinks (I'll use the suggested names above, so adjust if you wish) -

Code: [Select]
ln -s /mnt/NAS-20GB ~/NAS-Shares/Wallpapers
ln -s /mnt/NAS-200GB ~/NAS-Shares/Main_Share

Now lets make sure the ~/NAS-Shares directory ISN'T writeable ..

Code: [Select]
chmod 555 ~/NAS-Shares

Now backup your /etc/fstab (just in case)

Code: [Select]
sudo cp -v /etc/fstab /etc/fstab.backup

Open fstab for editing:

Code: [Select]
sudo nano /etc/fstab

and add the two lines at the bottom so it reads:-

Code: [Select]
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=ff0a5255-09f5-4b23-a2d2-8db9cebc726d /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=652469de-ef92-47ea-8e42-25deb43687fe none            swap    sw              0       0
/dev/sdb1 /mnt/NAS-200GB       ext3       rw,errors=remount-ro       0       0
/dev/sdc1 /mnt/NAS-20GB       ext3       rw,errors=remount-ro       0       0

SAVE fstab ..

Now run:
Code: [Select]
sudo mount -a

and post any output.

If nothing is returned .. post the output from:
Code: [Select]
mount



Is there anything currently on those drives ?

IF YES .. can you confirm you can see the contents with:
Code: [Select]
ls ~/NAS-Shares/Wallpapers
and
Code: [Select]
ls ~/NAS-Shares/Main_Share
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 15, 2012, 03:00:28 pm

If nothing is returned .. post the output from:
Code: [Select]
mount

/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none 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)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
none on /var/lib/ureadahead/debugfs type debugfs (rw,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
/dev/sdb1 on /media/Storage type ext3 (rw,nosuid,nodev,uhelper=udisks)
/dev/sdc1 on /media/Storage 2 type ext3 (rw,nosuid,nodev,uhelper=udisks)
/dev/sdb1 on /mnt/NAS-200GB type ext3 (rw,errors=remount-ro)
/dev/sdc1 on /mnt/NAS-20GB type ext3 (rw,errors=remount-ro)


Quote
Is there anything currently on those drives ?

Nope.
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 03:07:19 pm
I'm a bit baffled as to why they are being mounted twice .. unless you're manually mounting them.

Can you reboot the server .. then send the output from:
Code: [Select]
mount

and DID you format them as ext3 or ext4 ?
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 15, 2012, 03:24:00 pm
Can you reboot the server .. then send the output from:
Code: [Select]
mount

(click to show/hide)

Quote
and DID you format them as ext3 or ext4 ?

i formatted them as EXT3.
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 03:34:37 pm
OK .. is samba installed ?

What are the contents of:
Code: [Select]
nano /etc/samba/smb.conf
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 15, 2012, 04:00:26 pm
Yes, samba is installed and working correctly, although Samba on my lappy doesn't. It won't find any other devices on the network. :o
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 04:05:10 pm
And what are the contents of /etc/samba/smb.conf on the server ?

We'll worry about your laptop later
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 15, 2012, 04:43:50 pm
Contents of smb.conf for the NAS:

(click to show/hide)
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 05:05:40 pm
Add a new section at the bottom that reads:-

Quote
# NAS shares - added by BkS
[NAS Shares]
   path = /home/bks/NAS-Shares
;   available = yes
;   browseable = yes
   guest ok = yes
   writeable = yes

Save the file.

Restart samba:
Code: [Select]
sudo service smbd restart



Now go to your laptop .. open the pcmanfm file manager .. in the address bar, enter:
Code: [Select]
smb://192.168.0.8
and hit enter.

What is visible ?
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 15, 2012, 05:16:54 pm
I got errors.

Quote
Failed to retrieve share list from server

Quote
The specified location is not mounted
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 05:20:40 pm
When did you get that ?
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 15, 2012, 05:21:39 pm
When I put smb://192.168.0.8 into the address bar in pcmanfm
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 05:38:56 pm
Try rebooting both machines.

Then try again.
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 15, 2012, 06:02:09 pm
Right I'm able to access the NAS-Shares folder now, but I don't see any system links?

I have restarted booth machines and they are there though (I tweaked the path for the NAS-shares folder because I called it NAS):

Code: [Select]
ls ~/NAS
Quote
bks@bally-server:~$ ls ~/NAS
Main_Drive  Wallpapers
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 06:11:07 pm
The symlinks are the "Wallpapers" and " "Main_Drive" directories in NAS

can you navigate and write to them ?
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 15, 2012, 06:16:03 pm
That's what I'm saying. When I navigate to the NAS folder, the Wallpapers & Main_Drive directories aren't visible.
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 06:20:04 pm
on the server, what is the output from:
Code: [Select]
ls -a /home/bks/NAS-Shares
?
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 15, 2012, 06:24:09 pm
Quote
bks@bally-server:~$ ls -a /home/bks/NAS
.  ..  Main_Drive  Wallpapers
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 06:29:05 pm
Hmm.. maybe they have to be hard links ..

BUT

after looking through your smb.conf .. it looks like you may already have a directory specifically for sharing stuff

what's the output from
Code: [Select]
ls -a /home
and
Code: [Select]
ls -a /home/share

?
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 15, 2012, 07:25:37 pm
Quote
bks@bally-server:~$ ls -a /home
.  ..  bks  share

Quote
bks@bally-server:~$ ls -a /home/share
.  ..  it-works.txt
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 07:40:59 pm
And on your laptop, when you enter
smb://192.168.0.8/share
in the pcmanfm address bar.

can you see that
it-works.txt
file .. and can you edit it ?
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 15, 2012, 07:46:10 pm
Yes I can access that folder and edit that file.
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 08:25:07 pm
OK, let's go about this a different way then, and mount the drive/partitions directly into (a directory we'll create) there then :)

First create the mount points

Code: [Select]
sudo mkdir /home/share/NAS
sudo mkdir /home/share/NAS/Wallpapers
sudo mkdir /home/share/NAS/Share

now open fstab for editing:
Code: [Select]
sudo nano /etc/fstab

and change the 2 bottom lines so it reads:-
Code: [Select]
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=ff0a5255-09f5-4b23-a2d2-8db9cebc726d /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=652469de-ef92-47ea-8e42-25deb43687fe none            swap    sw              0       0
/dev/sdb1 /home/share/NAS/Share       ext3       rw,errors=remount-ro       0       0
/dev/sdc1 /home/share/NAS/Wallpapers       ext3       rw,errors=remount-ro       0       0

SAVE fstab.

open /etc/samba/smb.conf for editing
Code: [Select]
sudo nano /etc/samba/smb.conf

and remove that new section you added at the bottom ..

Then find the section that reads

Quote
[share]
 path = /home/share
 writeable = yes
 guest ok = yes
 guest only = yes
 create mode = 0777
 directory mode = 0777
 share mode = 0777

and change it to

Quote
[NAS]
 path = /home/share/NAS
 writeable = yes
 guest ok = yes
 guest only = yes
 create mode = 0777
 directory mode = 0777
 share mode = 0777

SAVE the smb.conf file.

Reboot the server.

On the laptop, try:
smb://192.168.0.8/share/NAS

Can you see the shares called "Wallpapers" and "Share" ?
Can you create and edit stuff on them ?

If so, we'll clean up the old now unused mount points and ~/NAS-Shares directory.
Title: Re: Mounting hard-drives from external sources.
Post by: SeZo on April 15, 2012, 09:15:26 pm
Is it neccesary to complicate things?
He already has this entry in fstab:
Quote
/dev/sdb1 /mnt/NAS-200GB       ext3       rw,errors=remount-ro       0       0
/dev/sdc1 /mnt/NAS-20GB       ext3       rw,errors=remount-ro       0       0

To start with create a /shared directory on each drive
Code: [Select]
sudo mkdir /mnt/NAS-20GB/shared
sudo mkdir /mnt/NAS-200GB/shared
Next change the permissions (allow access to everyone) on each newly created folder:
Code: [Select]
sudo chmod 0777 /mnt/NAS-20GB/shared
sudo chmod 0777 /mnt/NAS-200GB/shared

Then edit the samba config file:
nano /etc/samba/smb.conf

Remove previously added shares, then add 2 new entries (one per shared drive):

[Share]
comment = Public Folder
path = /mnt/NAS-200GB/shared
available = yes
browseable = yes
public = yes
writable = yes
create mask = 0777
directory mask = 0777

[Wallpapers]
comment = Wallpapers Folder
path = /mnt/NAS-20GB/shared
available = yes
browseable = yes
public = yes
writable = yes
create mask = 0777
directory mask = 0777
directory mask = 0777

SAVE the smb.conf file.

Reboot the server.

Now try on laptop:
smb://192.168.0.8/

You should see folders
Share & Wallpapers

Sorry Mark, not trying to step on your toes.
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 09:26:25 pm
You could do it that way .. but if your edits to smb.conf are ADDED (leaving the original [share] section), that leaves /home/share accessible and writeable from other machines .. effectively meaning people can save stuff on his system drive.

I thought it was "neater", creating a NAS directory in /home/share .. then EDITING the [share] section in smb.conf

the new mount points were just tidying up in case of problems .. but yeh, I suppose they were unnecessary :)
Title: Re: Mounting hard-drives from external sources.
Post by: SeZo on April 15, 2012, 09:33:10 pm
Quote
You could do it that way .. but if your edits to smb.conf are ADDED (leaving the original [share] section),

That is why I am asking to remove the previous shares from the smb.conf file  ;)

I am for simple life. By adding the shared directories on each drive will allow him to put
stuff there (outside of shared) what he does not necessarily want to share out.
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 09:44:50 pm
Ahh .. OK, I was just trying to be neat.. having a single smb.conf entry .. and keep it all in one place, but your way is just as valid, and I suppose  slightly less work at the server end .. but if he decides to mount the shares on the clients, my way will only need a single entry in the clients fstab ;)

Also, I gather he wants to add another drive later .. so it would only need a mountpoint and an fstab entry .. done :)

I do agree I was over complicating things originally though .. with the symlinks :)
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 10:10:26 pm
Besides which, my missus says I'm good at over complicating things .. so why change what I'm "good at" ;)
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 10:37:07 pm
She also says I like to be "right" all the time .. so I'll shut up now, just to prove her wrong .. erm, now I'm confused  :o
Title: Re: Mounting hard-drives from external sources.
Post by: SeZo on April 15, 2012, 10:42:46 pm
Besides which, my missus says I'm good at over complicating things .. so why change what I'm "good at" ;)

You are not alone. I get that from my missus too.

As a minor point, should BkS follow your instructions then what would stop other users creating folders in the NAS (writable) folder: :)
Quote
[NAS]
 path = /home/share/NAS
 writeable = yes
 guest ok = yes
 guest only = yes
 create mode = 0777
 directory mode = 0777
 share mode = 0777
 
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 10:48:57 pm
Hmm .. good point.

See, I'm not always right .. so she must be wrong .. does that make me right again .. doh! ???
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 15, 2012, 10:52:41 pm
I can see "Share" & "Wallpapers" in smb://192.168.0.8/share

However I get denied permission to create any files. In either directory.
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 15, 2012, 11:13:34 pm
Let's start again and do it SeZo's way .. as he pointed out there is a glaring hole (that allows users to write to your main system hard drive) in my solution  :-[

what are the contents of:
Code: [Select]
nano /etc/fstab

and the output from:
Code: [Select]
ls -a /mnt
and
Code: [Select]
ls -a /home/share

and the contents of:
Code: [Select]
nano /etc/samba/smb.conf

and we'll get it right this time :)

His way will also allow you to put stuff on those drives that ISN'T shared if you ever wanted to.
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 15, 2012, 11:20:51 pm
*sighs*... ok.

Quote
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=ff0a5255-09f5-4b23-a2d2-8db9cebc726d /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=652469de-ef92-47ea-8e42-25deb43687fe none            swap    sw              0       0
/dev/sdb1 /mnt/share/NAS/Main_Drive       ext3       rw,errors=remount-ro       0       0
/dev/sdc1 /mnt/Wallpapers       ext3       rw,errors=remount-ro       0       0


Quote
bks@bally-server:~$ ls -a /mnt
.  ..  NAS-200GB  NAS-20GB

Quote
bks@bally-server:~$ ls -a /home/share
.  ..  it-works.txt  NAS

smb.conf contents:

(click to show/hide)
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 16, 2012, 12:23:41 am
Firstly .. I know why you couldn't write to those shares .. the last 2 lines in your fstab were totally wrong .. those directories don't exist, so the partitions wouldn't have been getting mounted at all  :o



OK .. editing fstab ..

Code: [Select]
sudo nano /etc/fstab

edit the last 2 lines, so it reads:-

Code: [Select]
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=ff0a5255-09f5-4b23-a2d2-8db9cebc726d /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=652469de-ef92-47ea-8e42-25deb43687fe none            swap    sw              0       0
/dev/sdb1 /mnt/NAS-200GB       ext3       rw,errors=remount-ro       0       0
/dev/sdc1 /mnt/NAS-20GB       ext3       rw,errors=remount-ro       0       0

SAVE fstab



reload fstab
Code: [Select]
sudo mount -a



create the 2 "share" directories .. and make them writeable by everyone:

Code: [Select]
sudo mkdir /mnt/NAS-20GB/share
sudo mkdir /mnt/NAS-200GB/share
sudo chmod 777 /mnt/NAS-20GB/share
sudo chmod 777 /mnt/NAS-200GB/share



Editing smb.conf -

REMOVE (or comment out) the section I've highlighted in RED
and add the 2 new sections I've highlighted in GREEN at the bottom.

Code: [Select]
sudo nano /etc/samba/smb.conf

(click to show/hide)

SAVE the file.



REBOOT the server.



On the laptop ..

When the server has rebooted .. (on the laptop) log off, and on again.

Now try:-
smb://192.168.0.8/

What can you see ?

If as expected you can see the Share and Wallpapers directories, can you write to them ?




Only do this once everything is working (or you can just leave them .. up to you) ..

cleaning up the old attempts -

Code: [Select]
sudo rm -r /home/bks/NAS-Shares
sudo rm -r /home/share/NAS



If you'd rather use UUID's than /dev/sdXY in fstab .. let me know, and send the output from:
Code: [Select]
blkid

You can still do all the above first .. then change to UUID's later, once it's all working.



@SeZo

Before you shout at me for changing the mount points back .. I KNOW it wasn't 100% necessary .. I'm just putting them back in /mnt where they belong ;)
Title: Re: Mounting hard-drives from external sources.
Post by: SeZo on April 16, 2012, 09:10:24 am
Quote
Before you shout at me for changing the mount points back .. I KNOW it wasn't 100% necessary .. I'm just putting them back in /mnt where they belong ;)

I would not dream of shouting at you. :D

On the other hand, it might be worth (to start with) to un-comment the ' security = share' in smb.conf
to allow access by others on the Lan without the need for user/password
Quote
####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
#   security = share
security = share

Also there is a mismatch in the directories:
sudo mkdir /mnt/NAS-20GB/share
sudo mkdir /mnt/NAS-200GB/share
and
/mnt/NAS-20GB/shared
/mnt/NAS-200GB/shared
in the smb.conf
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 16, 2012, 11:42:18 am
I can see the directories, although I cannot enter them. I get the same errors as before. and yes I fixed his error.
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 16, 2012, 12:45:22 pm
Gonna need the contents of fstab and smb.conf again.

plus the output from
Code: [Select]
ls -l /mnt
and
Code: [Select]
ls -l /mnt/NAS-20GB
and
Code: [Select]
ls -l /mnt/NAS-200GB
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 16, 2012, 02:16:12 pm
fstab:

(click to show/hide)


smb.conf

(click to show/hide)


Quote
bks@bally-server:~$ ls -l /mnt
total 8
drwx------ 4 bks bks 4096 2012-04-16 11:21 NAS-200GB
drwx------ 4 bks bks 4096 2012-04-16 11:21 NAS-20GB

Quote
bks@bally-server:~$ ls -l /mnt/NAS-20GB
total 20
drwx------ 2 root root 16384 2012-04-14 13:05 lost+found
drwxrwxrwx 2 root root  4096 2012-04-16 11:21 share

Quote
bks@bally-server:~$ ls -l /mnt/NAS-200GB
total 20
drwx------ 2 root root 16384 2012-04-14 13:08 lost+found
drwxrwxrwx 2 root root  4096 2012-04-16 11:21 share


 :-\
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 16, 2012, 02:37:21 pm
OK, let's try this:-

Code: [Select]
sudo nano /etc/samba/smb.conf

and change

Code: [Select]
# NAS-20GB added by BkS
[Wallpapers]
comment = Wallpapers Folder
path = /mnt/NAS-20GB/share
available = yes
browseable = yes
public = yes
writable = yes
create mask = 0777
directory mask = 0777

# NAS-200GB added by BkS
[Share]
comment = Public Folder
path = /mnt/NAS-200GB/share
available = yes
browseable = yes
public = yes
writable = yes
create mask = 0777
directory mask = 0777

to

Code: [Select]
# NAS-20GB added by BkS
[Wallpapers]
comment = Wallpapers Folder
path = /mnt/NAS-20GB/share
writeable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777
share mode = 0777

# NAS-200GB added by BkS
[Share]
comment = Public Folder
path = /mnt/NAS-200GB/share
writeable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777
share mode = 0777

SAVE smb.conf

reboot both machines .. and try again.

[EDIT]

If that doesn't work .. leave it like that .. and send the output from
Code: [Select]
ls -l /home
and
Code: [Select]
mount
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 16, 2012, 03:33:56 pm
Can't access them again. Same errors.

Quote
Failed to mount Windows share

Quote
The specified location is not mounted





Quote
bks@bally-server:~$ ls -l /home
total 8
drwxr-xr-x 27 bks  bks  4096 2012-04-15 17:57 bks
drwxrwxrwx  3 root root 4096 2012-04-15 22:45 share

Quote
bks@bally-server:~$ mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none 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)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
/dev/sdb1 on /mnt/NAS-200GB type ext3 (rw,errors=remount-ro)
/dev/sdc1 on /mnt/NAS-20GB type ext3 (rw,errors=remount-ro)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 16, 2012, 04:07:14 pm
Hmm .. that *should* be working ??? .. everything is set up exactly the way the original /home/share which worked ???

Gimme a while to test whether it's sambs not liking the "-" in the file names NAS-20GB and NAS-200GB

I know it didn't like them when I tested sommat like smb:// 172.16.0.2/test-directory (kept getting replaced with smb://172.16.0.2/test%25directory .. or similar)

maybe it doesn't like then in the "path =" line either.

I'll get back to you shortly.
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 16, 2012, 05:15:15 pm
First, it's NOT the "-" in the path as I wondered earlier ???

I'm now somewhat baffled as to why that doesn't work ..

I just created
/mnt/NAS-20GB/share
and
/mnt/NAS-200GB/share

on my 11.10 box .. made them both (777) writeable by everyone.

put:-
Code: [Select]
# NAS-20GB added by BkS
[Wallpapers]
comment = Wallpapers Folder
path = /mnt/NAS-20GB/share
writeable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777
share mode = 0777

# NAS-200GB added by BkS
[Share]
comment = Public Folder
path = /mnt/NAS-200GB/share
writeable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777
share mode = 0777

in my smb.conf

REBOOTED the server.

REBOOTED the PeppermintOS netbook

Now if (on the netbook) I open pcmanfm and enter smb://172.16.0.2/

I can see (and write to) "Share" and "Wallpapers"

so it SHOULD be working on your system. ???

did you reboot BOTH the server and laptop ?

have you tried accessing the shares on another PC .. to rule out your Peppermint PC as the culprit ?
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 16, 2012, 05:39:34 pm
Quick question ,,

When I ask for the contents of fstab, smb.conf, etc, ... you ARE getting them from the server aren't you, and not just cobbling then together from what's  been posted earlier ?
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 16, 2012, 05:56:27 pm
Yes I rebooted both. I've tried on my brothers Ubuntu box and my mums partners Win7 box. Both of them can't access the directories either.

Yeah I'm getting them from terminal.
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 16, 2012, 06:10:38 pm
OK .. lets go through this one step at a time.

I know I've asked for them before, but post the contents of:-

Code: [Select]
sudo nano /etc/samba/smb.conf
and
Code: [Select]
sudo nano /etc/fstab

and the output from:
Code: [Select]
mount
and
Code: [Select]
ls -l /mnt/NAS-20GB
and
Code: [Select]
ls-l /mnt/NAS-200GB
and
Code: [Select]
sudo fdisk -l

can you also try this:
Code: [Select]
mkdir /mnt/NAS-200GB/share/testdir
I just want to know if this works.

Meanwhile .. I'll test if the fstab entries make a difference by formatting a USB stick as ext3 and mounting it from fstab as /mnt/NAS-200GB  then creating a dir on it called share .. in the same way as you are, and see what happens.
Title: Re: Mounting hard-drives from external sources.
Post by: SeZo on April 16, 2012, 06:20:35 pm
@BkS

Try this:

Code: [Select]
sudo chmod -R 777 /mnt/NAS-20GB
sudo chmod -R 777 /mnt/NAS-200GB

Reboot NAS and see if that makes any difference
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 16, 2012, 06:37:30 pm
Yup .. listen to SeZo .. I just made the same setup with a USB stick, and the directory was unreadable, till I -
Code: [Select]
sudo chmod 777 /mnt/NAS-200GB

then it WAS readable.

Still dunno why it needs  that though ???
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 16, 2012, 06:41:34 pm
Code: [Select]
sudo nano /etc/samba/smb.conf
(click to show/hide)

Quote
Code: [Select]
sudo nano /etc/fstab

(click to show/hide)

Quote
Code: [Select]
mount

(click to show/hide)

Quote
Code: [Select]
ls -l /mnt/NAS-20GB

(click to show/hide)

Quote
Code: [Select]
ls-l /mnt/NAS-200GB

(click to show/hide)

Quote
Code: [Select]
sudo fdisk -l

(click to show/hide)

Quote
can you also try this:
Code: [Select]
mkdir /mnt/NAS-200GB/share/testdir
I just want to know if this works.

Yes I can make that directory:

Quote
bks@bally-server:~$ ls /mnt/NAS-200GB/share/
testdir
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 16, 2012, 06:52:11 pm
SeZo, you deserve a medal. :D

It works now!
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 16, 2012, 06:54:13 pm
I'm still wondering WHY that worked though ?

I considered it earlier, but could see no reason for it ???
Title: Re: Mounting hard-drives from external sources.
Post by: SeZo on April 16, 2012, 07:04:45 pm
Medals???
Didn't know they are giving those out here.

Lucky guess I suppose. Mark has done all the work, thank him.

I'm still wondering WHY that worked though ?

I considered it earlier, but could see no reason for it ???

I am guessing that when you CHMOD a file or folder, some servers require you also CHMOD
the folder holding it to the same level of permissions for it to work. ???
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 16, 2012, 07:12:38 pm
Well it certainly "looks" that way .. just a bit baffled by it though.

I'm guessing it's a Samba quirk, because I've never had to do that when mounting across the network with cifs or even smbfs (or obviously locally).

Weird  :o

Quote from: SeZo
Medals???
Didn't know they are giving those out here.


The forum has got an "Awards" feature, with piccies of medals .. we've just not implemented it .. to tell the truth, I've not looked into how t works.

These are the awards ;)

(http://linuxforums.org.uk/awards/12.png)  (http://linuxforums.org.uk/awards/21.png)  (http://linuxforums.org.uk/awards/14.png)
(http://linuxforums.org.uk/awards/15.png)  (http://linuxforums.org.uk/awards/17.png)  (http://linuxforums.org.uk/awards/18.png)  (http://linuxforums.org.uk/awards/19.png)
(http://linuxforums.org.uk/awards/16.png)  (http://linuxforums.org.uk/awards/20.png)

Quote from: SeZo
Lucky guess I suppose. Mark has done all the work, thank him.


SeZo, you may as well accept the thanks, not only did you come up with the answer, but he doesn't thank me any more [snivel] .. one of us may as well get thanked ;)

Just pulling your leg BkS :)
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 16, 2012, 07:40:48 pm
LOL, "Asshole of the month". That's brilliant.
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 16, 2012, 07:47:17 pm
Yeh .. I've wanted to use that one before.

Remember this:
http://linuxforums.org.uk/index.php?topic=2552.msg61331#msg61331 (http://linuxforums.org.uk/index.php?topic=2552.msg61331#msg61331)
and the topic that prompted that ?
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on April 16, 2012, 07:51:19 pm
Oh how he/she deserved that award. You were going of your head lol. I still have the PM's XD
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on April 16, 2012, 07:55:47 pm
:)
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on January 26, 2013, 07:25:02 pm
Bumpity bump.

I've got all my old stuff up and running, however I want to add a new drive.

So far what I have done is:

Identified drive as: /dev/sdd

Added to my fstab:

/dev/sdd /mnt/NAS-40GB   ext3    rw,errors=remount-ro     0       0

I've also created the directories:

/mnt/NAS-40GB
/mnt/NAS-40GB/share


That's as far as I've gotten. I am doing things correctly yes?

EDIT: I have also created a symlink that works perfectly.
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on January 26, 2013, 07:48:34 pm
What is /mnt/NAS-40GB/share  for ?

You can easily test it with
Code: [Select]
sudo mount -a
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on January 26, 2013, 07:56:04 pm
The "share" directory is where the content will go. I have one in all my drives, as I dont want anything outside of a shared directory.

Everything seems to work fine according to mount -a. 

Great success! ;D
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on January 26, 2013, 07:59:48 pm
Well shouldn't the "share" directory have been created AFTER the /mnt/NAS-40GB was mounted .. so it was created ON THE DRIVE ?
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on January 26, 2013, 08:06:36 pm
It was created AFTER it was mounted. ;) I have learned a few things y'know.
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on January 26, 2013, 08:51:06 pm
OK .. don't get your snickers in a twit :P
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on January 26, 2013, 08:57:15 pm
Haha, anyway on a more serious note, I've just connected the server to the network only to find it won't ping, HOWEVER, miniDLNA is working and I can access the movies, photos, etc? But the server itself won't show up on Nautilus or Window's explorer in order to browse the files.

Doesn't make sense...
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on January 26, 2013, 09:13:55 pm
What do you mean t won't ping .. you've tried pinging it's IP from another PC ?
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on January 26, 2013, 09:17:08 pm
Yep, tried it from my laptop, my mums laptop, and my Nexus 7, and my phone... no replies. ???

I get:

Quote
Host Unreachable
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on January 26, 2013, 09:21:30 pm
Can you ping other PC's from the server ?

have you got any iptables rules set
Code: [Select]
sudo iptables -L

What's the output from
Code: [Select]
ifconfig

Have you tried another ethernet cable, and/or checked there's no dust blocking the connections in the ethernet socket.
Title: Re: Mounting hard-drives from external sources.
Post by: SeZo on January 26, 2013, 10:25:57 pm
Is samba running? :-\
Have you modified the config for it?
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on January 26, 2013, 10:55:23 pm
Can you ping other PC's from the server ?

have you got any iptables rules set
Code: [Select]
sudo iptables -L

Nothing is setup.

Quote
What's the output from
Code: [Select]
ifconfig

(click to show/hide)



Since I restarted the server, it seems to be responding to pings. Now the only problem is, Windows clients can't access the server, I think something may be wrong with samba, here's my smb.conf.

(click to show/hide)


Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on January 27, 2013, 12:54:30 am
Here's my peppermint smb.conf for comparison:-

(click to show/hide)

So you might want to try:-

(click to show/hide)

..
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on January 27, 2013, 01:43:40 am
Restarting samba seems to have solved the issue. Guess I forgot to refresh the configuration file?

The only problem I'm having is I can't write to the new shared folder which is in /mnt/NAS-40GB/share.

I've chmod 555 to /mnt/NAS-40GB and chmod 777 /mnt/NAS-40GB/share, but still no write access?
Title: Re: Mounting hard-drives from external sources.
Post by: Mark Greaves (PCNetSpec) on January 27, 2013, 09:57:51 am
Can you write to it locally:
Code: [Select]
touch /mnt/NAS-40GB/share/testfile
and
Code: [Select]
sudo touch /mnt/NAS-40GB/share/sudo-testfile
then
Code: [Select]
ls -a /mnt/NAS-40GB/share
?
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on January 27, 2013, 01:39:32 pm
Yeah I can write locally. Can't post output because I'm SSH'ing for my Nexus7.
Title: Re: Mounting hard-drives from external sources.
Post by: SeZo on January 27, 2013, 02:10:40 pm
Restarting samba seems to have solved the issue. Guess I forgot to refresh the configuration file?

The only problem I'm having is I can't write to the new shared folder which is in /mnt/NAS-40GB/share.

I've chmod 555 to /mnt/NAS-40GB and chmod 777 /mnt/NAS-40GB/share, but still no write access?

Perhaps it should be:
Code: [Select]
sudo chmod -R 777 /mnt/NAS-40GB
Title: Re: Mounting hard-drives from external sources.
Post by: BkS on January 27, 2013, 02:35:38 pm
Restarting samba seems to have solved the issue. Guess I forgot to refresh the configuration file?

The only problem I'm having is I can't write to the new shared folder which is in /mnt/NAS-40GB/share.

I've chmod 555 to /mnt/NAS-40GB and chmod 777 /mnt/NAS-40GB/share, but still no write access?

Perhaps it should be:
Code: [Select]
sudo chmod -R 777 /mnt/NAS-40GB

Thank you sir. All working perfectly now!  8) :D
Title: Re: Mounting hard-drives from external sources.
Post by: SeZo on January 27, 2013, 11:15:35 pm
Quote
Thank you sir. All working perfectly now!  8) :D

You are welcome - again ;)
SimplePortal 2.3.3 © 2008-2010, SimplePortal