Author Topic: Mounting hard-drives from external sources. [Solved]  (Read 14330 times)

0 Members and 1 Guest are viewing this topic.

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18231
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #30 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" ;)
« Last Edit: April 15, 2012, 10:35:54 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18231
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #31 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
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 142
  • Gender: Male
    • View Profile
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #32 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
 

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18231
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #33 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! ???
« Last Edit: April 15, 2012, 10:51:29 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline BkS

  • BkS Media Founder
  • Hero Member
  • *****
  • Posts: 1691
  • Karma: 49
  • Gender: Male
  • sudo service reality-check start
    • View Profile
    • BkS Media
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #34 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.
If you try to look through Windows, you can see what the person is doing.
If you try to look through a Penguin, it WILL bite you.

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18231
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #35 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.
« Last Edit: April 15, 2012, 11:23:15 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline BkS

  • BkS Media Founder
  • Hero Member
  • *****
  • Posts: 1691
  • Karma: 49
  • Gender: Male
  • sudo service reality-check start
    • View Profile
    • BkS Media
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #36 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)
If you try to look through Windows, you can see what the person is doing.
If you try to look through a Penguin, it WILL bite you.

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18231
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #37 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 ;)
« Last Edit: April 16, 2012, 01:33:02 am by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 142
  • Gender: Male
    • View Profile
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #38 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
« Last Edit: April 16, 2012, 10:15:58 am by SeZo »

Offline BkS

  • BkS Media Founder
  • Hero Member
  • *****
  • Posts: 1691
  • Karma: 49
  • Gender: Male
  • sudo service reality-check start
    • View Profile
    • BkS Media
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #39 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.
« Last Edit: April 16, 2012, 11:48:27 am by BkS »
If you try to look through Windows, you can see what the person is doing.
If you try to look through a Penguin, it WILL bite you.

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18231
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #40 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
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline BkS

  • BkS Media Founder
  • Hero Member
  • *****
  • Posts: 1691
  • Karma: 49
  • Gender: Male
  • sudo service reality-check start
    • View Profile
    • BkS Media
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #41 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


 :-\
If you try to look through Windows, you can see what the person is doing.
If you try to look through a Penguin, it WILL bite you.

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18231
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #42 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
« Last Edit: April 16, 2012, 03:15:11 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline BkS

  • BkS Media Founder
  • Hero Member
  • *****
  • Posts: 1691
  • Karma: 49
  • Gender: Male
  • sudo service reality-check start
    • View Profile
    • BkS Media
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #43 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)
« Last Edit: April 16, 2012, 03:36:02 pm by BkS »
If you try to look through Windows, you can see what the person is doing.
If you try to look through a Penguin, it WILL bite you.

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18231
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #44 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.
« Last Edit: April 16, 2012, 04:09:33 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal