Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
symlinks and samba
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
gdoubleu
Tux's lil' helper
Tux's lil' helper


Joined: 07 May 2003
Posts: 80

PostPosted: Sun Apr 18, 2004 9:29 pm    Post subject: symlinks and samba Reply with quote

i'm trying to copy an entire system to a newly created raid array on a new computer using samba, but am having problems getting the symlinks to copy correctly.
anyone know how to copy symlinks with samba?

i've tried setting
Code:
unix extensions = yes
in my samba config file, but that doesn't seem to work

i'm trying to set up the new system rooted at /mnt/new/
the current system is mounted via smbmount at /mnt/old/
to copy, i am using
Code:
cp -av /mnt/old/foo /mnt/new/


after performing the copy command, files with the same names as the symlinks exist, but they are not symlinks
what am i doing wrong here?
Back to top
View user's profile Send private message
meowsqueak
Veteran
Veteran


Joined: 26 Aug 2003
Posts: 1549
Location: New Zealand

PostPosted: Sun Apr 18, 2004 9:32 pm    Post subject: Reply with quote

cp -a is meant to preserve symlinks, so I can only think that samba is somehow distorting the meaning, resulting in a copy of the target file instead. Perhaps there's a samba option that influences this?
Back to top
View user's profile Send private message
gdoubleu
Tux's lil' helper
Tux's lil' helper


Joined: 07 May 2003
Posts: 80

PostPosted: Mon Apr 19, 2004 4:10 am    Post subject: Reply with quote

well, the three samba options that i could find that mention symlinks were 'unix extensions', 'follow symlinks', and 'wide links':
Code:
       unix extensions(G)
              This boolean parameter controls whether Samba implments the CIFS
              UNIX  extensions,  as  defined  by  HP.  These extensions enable
              Samba to better serve UNIX CIFS clients by  supporting  features
              such  as  symbolic  links,  hard links, etc...  These extensions
              require a similarly enabled client, and are of no current use to
              Windows clients.

              Default: unix extensions = no

       follow symlinks (S)
              This parameter allows the Samba administrator  to  stop  smbd(8)
              from  following  symbolic  links  in a particular share. Setting
              this parameter to no prevents any file or directory  that  is  a
              symbolic  link from being followed (the user will get an error).
              This option is very useful to stop users from adding a  symbolic
              link  to  /etc/passwd in their home directory for instance. How-
              ever it will slow filename lookups down slightly.

              This option is enabled (i.e. smbd will follow symbolic links) by
              default.

              Default: follow symlinks = yes

       wide links (S)
              This  parameter  controls  whether or not links in the UNIX file
              system may be followed by the server. Links that point to  areas
              within  the  directory  tree  exported  by the server are always
              allowed; this parameter controls access only to areas  that  are
              outside the directory tree being exported.

              Note  that  setting this parameter can have a negative effect on
              your server performance due to the extra system calls that Samba
              has to do in order to perform the link checks.

              Default: wide links = yes

The 'follow symlinks' and 'wide links' options are already default to yes, and adding the 'unix extensions = yes' doesn't do the trick either. It's also not the copy function because just viewing through samba the symlinks don't show up as symlinks.
Back to top
View user's profile Send private message
thm
Tux's lil' helper
Tux's lil' helper


Joined: 15 Dec 2003
Posts: 77
Location: Munich

PostPosted: Mon Apr 19, 2004 1:25 pm    Post subject: tar may be more appropriate Reply with quote

One can spend a lot of time arguing about the behaviour of the cp utility in itself and in combination with samba. It's not very systematic in some respects. :?

To reliably replicate entire file system (sub)trees, it is much better to use two instances of tar. Using tar even copies pipes and other special nodes properly. Of course, this only works if you have execute access to both machines. You could even try and pipe both instances together and aviod a large temporary file.
_________________
Thomas
Back to top
View user's profile Send private message
sven-tek
Guru
Guru


Joined: 06 May 2003
Posts: 339

PostPosted: Wed Jun 09, 2004 6:11 am    Post subject: Reply with quote

i have done this by using cpio, read the cpio manpage - i dont remeber the exact expression
Back to top
View user's profile Send private message
thm
Tux's lil' helper
Tux's lil' helper


Joined: 15 Dec 2003
Posts: 77
Location: Munich

PostPosted: Wed Jun 09, 2004 3:42 pm    Post subject: Reply with quote

sven-tek wrote:
i have done this by using cpio, read the cpio manpage - i dont remeber the exact expression

tar and cpio do by and large the same thing. They differ somewhat in the optional processing they offer.
_________________
Thomas
Back to top
View user's profile Send private message
step
Apprentice
Apprentice


Joined: 16 May 2002
Posts: 198

PostPosted: Thu Aug 12, 2004 6:42 am    Post subject: Reply with quote

i had a similar problem with symlinks
then i did this:

follow symlinks = yes
wide links = yes
unix extensions = no

and now my links work OK under linux.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum