View Single Post
Old 25-06-2012, 18:48   #2
Intrepido
Senior Member
 
L'Avatar di Intrepido
 
Iscritto dal: Feb 2007
Messaggi: 7121
Se il WD supporta NFS allora sarebbe meglio quello, ma se devi condividere anche con Win allora devi usare samba.


Prima però devi montare i dischi nell'fstab, anzi prima devi creare un punto di mount.

Apri un terminale (ctrl+alt+t) e crea tante cartelle quanti i dischi che devi montare, quindi

sudo mkdir /media/Volume1

sudo mkdir /media/Volume2

e così per tutti i dischi cambiando il numero finale.

quindi sempre da terminale

sudo blkid

vedrai l'uuid dei dischipresenti e il loro file system con molta probabilità i dischi sono in ntfs, quindi dovrai montarli così (se sono fat o ext allora ti spiegherò il da farsi):

sudo gedit /etc/fstab

e aggiungi in fondo le righe:

Quote:
UUID=98cbaa3b-067c-4e67-ac6d-7c33e12a9c23 /media/Volume1 ntfs-3g defaults,umask=007,gid=46,uid=1000 0 0
UUID=48cbaa3b-067c-4e67-ac6d-7c45e12a9c78 /media/Volume2 ntfs-3g defaults,umask=007,gid=46,uid=1000 0 0
quindi crea tanta righe quante le cartelle che hai creato prima cambiando sempre l'uuid con quello del disco e cambiando il numero del volume con quello successivo, seperò di essermi spiegato bene , semmai chiedi.

a questo punto monta di dischi:

sudo mount -a

se i dischi sono in ntfs i permessi non vanno cambiati.



Ed ora Samba, apri un terminale (ctrl+alt+t) e digita i seguenti comandi:


sudo apt-get install samba

sudo /etc/init.d/smbd stop

sudo /etc/init.d/nmbd stop

sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.backup

sudo gedit /etc/samba/smb.conf

a questo punto si apre il file di testo da modificare (non ti preoccupare, se sbagli ti ho fatto fare una copia al passaggio 4), copia dentro questo:

Quote:
[global]
; General server settings
netbios name = TUO_NOME
server string =
workgroup = TUO_WORKGROUP
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

passdb backend = tdbsam
security = user
null passwords = true
username map = /etc/samba/smbusers
name resolve order = hosts wins bcast

wins support = yes

printing = CUPS
printcap name = CUPS

syslog = 1
syslog only = yes

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[print$]
path = /var/lib/samba/printers
browseable = yes
guest ok = yes
read only = yes
write list = root
create mask = 0664
directory mask = 0775

[printers]
path = /tmp
printable = yes
guest ok = yes
browseable = no

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[Share]
path = /home/casa/share
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = TUO_USERNAME
force group = TUO_USERGROUP
Come si compila: nella sezione [global] in netbios name metti il nome del tuo nas, in workgroup il tuo gruppo di lavoro,

In [Share] sotto la voce path va il percorso della cartella o disco che devi condividere, force group e force user il tuo utente.

Devi ripetere il paragrafo [Share] per ogni cartella che vuoi condividere.

Dovrai anche cambiare i permessi, ma questi li vediamo dopo.

Ora aggiungiamo il tuo utente e lo abilitamo

sudo smbpasswd -L -a tuo_username

sudo smbpasswd -L -e tuo_username

e riavvia il servizio

sudo /etc/init.d/smbd start

sudo /etc/init.d/nmbd start


O riavvia il pc.

Adesso in risorse di rete trovi le cartelle condivise.
Intrepido è offline   Rispondi citando il messaggio o parte di esso