System = SunOS Node = jaguar Release = 5.11 KernelID = snv_133 Machine = i86pc BusType = <unknown> Serial = <unknown> Users = <unknown> OEM# = 0 Origin# = 1 NumCPU = 1 Hi Folks, I seem to have a problem changing the owner of a symlinked directory. As root... mkdir a chown admin:audiogroup a ln -s a b Directory "b" shows up owned by root, but I can''t change it from this. I can''t change the mod permissions either. "chown admin:audiogroup b" doesn''t work. There doesn''t seem to be a lchown command. Also trying the -L switch would change the linked-to file if I read correctly. Can anyone shed light please? Many thanks, Michelle. -- This message posted from opensolaris.org
Michelle Knight schreef op 03-05-10 10:23:> I seem to have a problem changing the owner of a symlinked directory. > > As root... > > mkdir a > chown admin:audiogroup a > ln -s a b > > Directory "b" shows up owned by root, but I can''t change it from this. I can''t change the mod permissions either. > > "chown admin:audiogroup b" doesn''t work. There doesn''t seem to be a lchown command. Also trying the -L switch would change the linked-to file if I read correctly.Use chown -h to change the ownership of the link itself. Onno -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 258 bytes Desc: OpenPGP digital signature URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20100503/36d7da4f/attachment.bin>
Great stuff- Many thanks! -- This message posted from opensolaris.org
Urk - my only problem now is that they don''t seem to be showing in the published zfs smb share. -- This message posted from opensolaris.org
Got it - I used cp -L -R to symlnk copy the whole structure instead. Messy, but it does the job. Thanks for all the advice! Much appreciated. -- This message posted from opensolaris.org
Well, This is the overall issue. I have a music collection. The top level folders contain a letter for each artist and each letter then contains a separate folder for each artist. Nice and easy to organise and navigate. A - ACDC - Alanis Morisett B - BeeGees However ... I wanted to create a folder that contains the contents of all 26 folders ... a list of all the artists. Entirelist - ACDC - Alanis Morisett - Bee Gees What I''ve been doing is creating links in the entirelist folder, which contain links to the sub-folders in each of the letters. very quick, very simple. However, despite having access to all the folders and files, they don''t show up in the ZFS SMB share. This means I''ve got to resort to using cp -L -R /music/A/* /music/entirelist cp -L -R /music/B/* /music/entirelist ...etc. and this takes a long time and probably hammers the hard disk harder than necessary. Anyone with any better ideas than this please? -- This message posted from opensolaris.org
... and now I''ve discovered that cp -L doesn''t create symlinks. Back to the drawing board. -- This message posted from opensolaris.org
On 05/ 3/10 12:44 PM, Michelle Knight wrote:> ... and now I''ve discovered that cp -L doesn''t create symlinks. > > Back to the drawing board. >You need to do it the other way round. Create a directory with all your artists and then create symlinks for A, B, C etc so: everything/ACDC everything/Alainis Morisette everything/BeeGees symlinks/A/ACDC -> everything/ACDC symlinks/A/Alainis Morisette -> everything/Alainis Morisette symlinks/B/BeeGees -> everything/BeeGees You can off course create a script which will maintain the symlinks.
Michelle Knight schreef op 03-05-10 11:41:> What I''ve been doing is creating links in the entirelist folder, which contain links to the sub-folders in each of the letters. very quick, very simple. However, despite having access to all the folders and files, they don''t show up in the ZFS SMB share. > > This means I''ve got to resort to using > cp -L -R /music/A/* /music/entirelist > cp -L -R /music/B/* /music/entirelist > ...etc. and this takes a long time and probably hammers the hard disk harder than necessary. > > Anyone with any better ideas than this please?As you noticed, cp -L doesn''t create symlinks: it dereferences existing ones. (turns them into ordinary files/directories in the copy) You could try something like this instead: cd /music/entirelist ln -s ../?/* . This will create symlinks in /music/entirelist to everything that''s in the letter-directories. If you also have other one-character directories in music, you might want to use [A-Z] instead of ?. Onno -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 258 bytes Desc: OpenPGP digital signature URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20100503/c65af7ce/attachment.bin>
Beautiful! It worked. I can''t work out why the symlinks failed to show up in the share when I did it, but this way they are showing up fine. Thank you very much!!! -- This message posted from opensolaris.org
Hmmm ... no, it didn''t. I think it might be the sheer number of symlinks I''ve got in the directory. That might be causing problems with the ZFS smb share. -- This message posted from opensolaris.org
Now ... Why would this work... cd /mirror/audio/Cd-Tracks/0-entirelist ln -s ../a/* . ...but this fail ... ln -s /mirror/audio/Cd-Tracks/a/* /mirror/audio/Cd-Tracks/0-entirelist/. Any ideas? -- This message posted from opensolaris.org
The long ls command worked, as in it created the links, but they didn''t work properly under the ZFS SMB share. They didn''t work as in, on a remote Linux box, I could execute ls and see them, but I couldn''t change in; permission issues. (despite having the correct ownership) and also on the remote linux box, the GUI file browser couldn''t even see the folders. By changing in to the directory and then executing the ls command relative to that point, everything worked. Odd. -- This message posted from opensolaris.org
> From: zfs-discuss-bounces at opensolaris.org [mailto:zfs-discuss- > bounces at opensolaris.org] On Behalf Of Michelle Knight > > I seem to have a problem changing the owner of a symlinked directory. > > As root... > > mkdir a > chown admin:audiogroup a > ln -s a b > > Directory "b" shows up owned by root, but I can''t change it from this. > I can''t change the mod permissions either. > > "chown admin:audiogroup b" doesn''t work. There doesn''t seem to be a > lchown command. Also trying the -L switch would change the linked-to > file if I read correctly.Don''t change perms of symlinks. They should always be 777. (Generally.) Perms are controlled by the object they point to.
On 5/3/2010 7:41 AM, Michelle Knight wrote:> The long ls command worked, as in it created the links, but they didn''t work properly under the ZFS SMB share. >I''m guessing you meant the ''long ln'' command? If you look at what those 2 commadns create you''ll notice (in the output of ls -l) that the target the link points to has been recorded in the link differently. One will be relative (../a/foo) and the other absolute (/mirror/audio-Cd-Tracks/a/foo). This can affect how the SMB server process these links when requests for them are made depending on how the parent directories are shared (or not shared.) The relative links should work I would think since they don''t ''leave'' the SMB share.> They didn''t work as in, on a remote Linux box, I could execute ls and see them, but I couldn''t change in; permission issues. (despite having the correct ownership) and also on the remote linux box, the GUI file browser couldn''t even see the folders. > >Are you also sharing these files to Windows machines? If you''re only sharing them to Linux machines, then NFS would be so much easier to use. You''ll still want relative links though. -Kyle> By changing in to the directory and then executing the ls command relative to that point, everything worked. > > Odd. >
> From: zfs-discuss-bounces at opensolaris.org [mailto:zfs-discuss- > bounces at opensolaris.org] On Behalf Of Kyle McDonald > > If you''re only sharing them to Linux machines, then NFS would be so > much > easier to use. You''ll still want relative links though.Only if you have infrastructure to sanitize the UID''s. If you have disjoint "standalone" machines, then samba winbind works pretty well to map usernames to locally generated unique UID''s. In which case, IMHO, samba is easier than NFS. However, if you do have some kind of domains LDAP, NIS, etc... then I agree 1,000% NFS is easier than samba.
On 5/3/2010 4:56 PM, Edward Ned Harvey wrote:>> From: zfs-discuss-bounces at opensolaris.org [mailto:zfs-discuss- >> bounces at opensolaris.org] On Behalf Of Kyle McDonald >> >> If you''re only sharing them to Linux machines, then NFS would be so >> much >> easier to use. You''ll still want relative links though. >> > Only if you have infrastructure to sanitize the UID''s. > > If you have disjoint "standalone" machines, then samba winbind works pretty > well to map usernames to locally generated unique UID''s. In which case, > IMHO, samba is easier than NFS. However, if you do have some kind of > domains LDAP, NIS, etc... then I agree 1,000% NFS is easier than samba. > >True, using local passwd files on more than a handful of machines can make adding and removing users and changing passwords a pain. But (and I could be wrong these days) in my experience, while the Samba server is great, the SMB client on linux can only mount the share as a single specific user, and all accesses to files in the share are performed as that user. Right? That to me makes SMB a less desirable filesystem then NFS where you can''t really tell the difference between that and UFS or whatever. -Kyle
> From: Kyle McDonald [mailto:kmcdonald at egenera.com] > > But (and I could be wrong these days) in my experience, while the Samba > server is great, the SMB client on linux can only mount the share as a > single specific user, and all accesses to files in the share are > performed as that user. Right? > > That to me makes SMB a less desirable filesystem then NFS where you > can''t really tell the difference between that and UFS or whatever.Depends on the Linux distro. For example, I know in ubuntu, you''re in your GUI file explorer, and you just click on "mount server" and specify the CIFS server. Then the fileserver is mounted via fuse, in your home dir, under a permission restricted subdir. So each user can mount any server as themselves, supporting all the normal stuff you''d like to support. Also, if desired, samba does support posix permissions. I don''t know how, and I don''t know any situation where I''d recommend it, but just to point out that''s also possible.
"One will be relative (../a/foo) and the other absolute (/mirror/audio-Cd-Tracks/a/foo)." Makes sense. I hadn''t actually noticed this. It is not only sharing to Linux machines but also using SFTP as well from outside, so I need things to be pretty much multi-functional and flexible. I don''t have any Microsoft machines any more. I survive by creating a pre-defined set of users and groups about 100 above the standard UIDs that all machines have. This gets around needing LDAP for a small home system. Oh, there is the old, modded original X-Box downstairs and that plays the media on those shares as well, so NFS isn''t ideal for me. Thanks for the help. -- This message posted from opensolaris.org