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

0 Members and 1 Guest are viewing this topic.

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18236
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #15 on: April 15, 2012, 05:38:56 pm »
Try rebooting both machines.

Then try again.
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 #16 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
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: 18236
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #17 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 ?
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 #18 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.
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: 18236
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #19 on: April 15, 2012, 06:20:04 pm »
on the server, what is the output from:
Code: [Select]
ls -a /home/bks/NAS-Shares
?
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 #20 on: April 15, 2012, 06:24:09 pm »
Quote
bks@bally-server:~$ ls -a /home/bks/NAS
.  ..  Main_Drive  Wallpapers
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: 18236
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #21 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

?
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 #22 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
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: 18236
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #23 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 ?
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 #24 on: April 15, 2012, 07:46:10 pm »
Yes I can access that folder and edit that file.
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: 18236
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #25 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.
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 #26 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.
« Last Edit: April 15, 2012, 09:23:57 pm by SeZo »

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18236
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #27 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 :)
« Last Edit: April 15, 2012, 09:28:53 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 SeZo

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

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18236
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Mounting hard-drives from external sources.
« Reply #29 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 :)
« Last Edit: April 15, 2012, 10:02: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

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal