Montando pasta compartilhada do Windows em diretório do Linux

Publicado por leandro bruno teixeira em 01/12/2010

[ Hits: 59.073 ]

 


Montando pasta compartilhada do Windows em diretório do Linux



Nessa dica mostrarei como se monta uma pasta compartilhada do Windows dentro de um diretório do Linux.

Para o exemplo aqui mostrado temos:
  • IP da máquina Windows: 10.0.0.3
  • Nome do compartilhamento = MP3
  • Caminho do compartilhamento = \\10.0.0.4\MP3

Primeiramente teremos que ter privilégio de administrador para instalar o pacote smbfs. Segundo, criaremos um diretório dentro de /mnt, o nome fica a seu critério, usei "mp3".

# apt-get update
# apt-get upgrade
# apt-get install smbfs
# mkdir /mnt/mp3


Depois que terminar de instalar o pacote e criar o diretório mp3 dentro de /mnt, já poderemos montar a pasta do Windows dentro de um diretório de sua máquina Linux.

# mount -t cifs -o guest //10.0.0.3/MP3 /mnt/mp3/
# cd /mnt/mp3
# ls

musica1.mp3 musica2.mp3

Bem pessoal, é isso aí, espero ter ajudado.

Viva a Liberdade
Leandro Bruno Teixeira

Outras dicas deste autor

Transformando imagem NRG em ISO no Linux

Testando se a conexão com a internet está ativa

GeoVision - Redirecionamento de portas

Leitura recomendada

Compartilhamentos Samba

Restaurando recurso DRBD com node primário rodando

Instalando um dedo-duro em seu compartilhamento SAMBA!

HD USB externo com filesystem JFS

Apagar arquivos da lixeira no Gnome, na marra!

  

Comentários
[1] Comentário enviado por laerciomotta em 02/12/2010 - 10:04h

Eu uso:

# mount -t smbfs //10.0.0.3/MP3 /mnt/mp3/

Ae ele pede senha eu do enter e boa

Quando preciso autenticar:

# mount -t smbfs //10.0.0.3/MP3 /mnt/mp3/ -o username=usuario,password=senha
ou
# mount -t smbfs //10.0.0.3/MP3 /mnt/mp3/ -o username=usuario

Nesse ultimo ele me pede para digitar a senha depois do enter...

[]'s

[2] Comentário enviado por jhonfelix em 25/10/2012 - 11:02h

Boa tarde pessoal,

Estou com o seguinte erro, ao executar o comando abaixo dá o erro também abaixo.
Comando:
mount -t smbfs -o username=***,password=*** //pcwindows /mnt/backup

Erro:

Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
or move a subtree:
mount --move olddir newdir
One can change the type of mount containing the directory dir:
mount --make-shared dir
mount --make-slave dir
mount --make-private dir
mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
mount --make-rshared dir
mount --make-rslave dir
mount --make-rprivate dir
mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say man 8 mount .


OBS. preciso de ajuda para resolver essa pane, para assim, salvar meu backup na máquina Windows.
Agradeço desde já pela força.....

[3] Comentário enviado por alaxricard em 03/05/2013 - 20:52h

Eu quero compartilhar dois HDs no Ubuntu Linux e para poder acessar os dois no Windows 8 ai queria saber como eu faço isso amigo, você pode me ajudar?

[4] Comentário enviado por leandrobrunoo em 04/05/2013 - 06:46h

Bom dia, você quer acessar os HDs do seu SO linux né isso ?
então vamos la, você ira precisar configura o SAMBA no seu SO Ubuntu.

http://www.vivaolinux.com.br/dica/Samba-para-Linux-acessar-Windows-e-viceversa

http://www.vivaolinux.com.br/artigo/Micro-curso-Samba

[5] Comentário enviado por walone em 01/09/2015 - 20:52h


[2] Comentário enviado por jhonfelix em 25/10/2012 - 11:02h

Boa tarde pessoal,

Estou com o seguinte erro, ao executar o comando abaixo dá o erro também abaixo.
Comando:
mount -t smbfs -o username=***,password=*** //pcwindows /mnt/backup

Erro:

Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
or move a subtree:
mount --move olddir newdir
One can change the type of mount containing the directory dir:
mount --make-shared dir
mount --make-slave dir
mount --make-private dir
mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
mount --make-rshared dir
mount --make-rslave dir
mount --make-rprivate dir
mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say man 8 mount .


OBS. preciso de ajuda para resolver essa pane, para assim, salvar meu backup na máquina Windows.
Agradeço desde já pela força.....


Neste seu exemplo faltou o nome do diretorio no pcwindows, como deveria ficar:
mount -t smbfs -o username=***,password=*** //pcwindows/diretorio /mnt/backup

Tente desta forma.

[6] Comentário enviado por Onix_gyll em 21/02/2018 - 07:53h

Bom dia.

A montagem consegui fazer de acordo o tutorial... Mas quando reinicio o sistema ela perde o direcionamento, existe a possibilidade de deixar automático tipo entrou no OS ele já monta??



Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts