No permissions to Drive I partitioned?

New to Debian (Or Linux in general)? Ask your questions here!

Re: No permissions to Drive I partitioned?

Postby LearningCurve » 2010-02-22 08:56

Thanks, I'll remember that.

Now I've just got to find my round copying the files from the Old VideoDrive to the new one as per my original post, next part of the plan. I effectively re-did what I have here on that drive after downloading ntfs-3g which went really smoothly. I like the Debian package manager, it can be such a pain in Mandriva, on another machine.

I tried using chown and chmod with -R but whilst the directories changed permissions, the files didn't? Strange, so I started to copy thinking that once the files are on the (new) VideoDrive I could then change their permissions if they hadn't done when copying onto a drive with different perms.

I used cp -R /mnt/OldDrive /VideoDrive and all started to go well. I knew it would take some time so as it was late I went to bed. However shortly after that we had a power cut which brought that to a halt.

I found that the copy had created a directory on VideoDrive called OldDrive and was copying into that! and all the permissions had stayed as root. So I am now trying to copy directories from within OldDrive ie

#/mnt/OldDrive cp -R media /VideoDrive

It seems to be working but I have left it to cook for a while. If all is ok I will then have to sort out the perms of the files, surely I won't have to go through the whole drive changing them directory by directory.

I really must try and find some time to to get into terminal properly, could you perhaps suggest a good tutorial?
User avatar
LearningCurve
 
Posts: 9
Joined: 2010-02-19 13:19

Re: No permissions to Drive I partitioned?

Postby fsmithred » 2010-02-22 13:34

Easy way is to make one directory on the drive, give ownership to user, and then copy the files as user into that directory from the old drive. Or else use cp with -p or -a to preserve file attributes. Then you don't have to change permissions afterward.

This one looks pretty good.
http://www.tuxfiles.org/linuxhelp/cli.html
fsmithred
 
Posts: 1872
Joined: 2008-01-02 14:52

.

Postby llivv » 2010-02-22 15:40

.
Last edited by llivv on 2019-04-17 21:26, edited 1 time in total.
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.
User avatar
llivv
 
Posts: 5484
Joined: 2007-02-14 18:10
Location: cold storage

Re: No permissions to Drive I partitioned?

Postby bluesdog » 2010-02-23 00:41

There's usually more than one way to do something in Linux.

Here's one way to make a user-owned folder in a mounted partition.

This example creates a folder called 'myfolder', and it will be located on physical device, /dev/hdc, mounted at /mnt/hdc The user is tom, and we'll also assign the 'tom' group to the folder:

su <enter>
password <type root password> <enter>
Code: Select all
mkdir /mnt/hdc/myfolder


Now give ownership to tom, and (optionally) to tom's group.
Code: Select all
chown -R tom:tom /mnt/hdc/myfolder


(Strictly speaking, the -R (recurse) switch is unneccessary in this example, because the newly-created folder has no contents. )

Now whenever /mnt/hdc is mounted, either manually by root command, or automatically by the /etc/fstab entry, tom will have full access to /mnt/hdc/myfolder

~~~

Another, less secure method would be to grant tom ownership of the mount point, after which he could create new folders as user.
This isn't a good method in a multi-user environment.
User avatar
bluesdog
 
Posts: 2082
Joined: 2006-02-01 09:02
Location: Similkameen, British Columbia, Canada

Re: No permissions to Drive I partitioned?

Postby LearningCurve » 2010-02-23 19:46

Hi,

llivv I think you may have either missed or misunderstood something here. In your latest post you quoted what I had said including that yes I am using Gnome. Although there is always more to learn, I do know a bit about it as I have been using Gnome desktop on another machine, Mandrake One 2009 Spring. It sounds as though you're not a Gnome fan and as it turned out the problems weren't with the desktop appsbut with my syntax during the process.

I have been playing with these things for 24 years, when not all PC's were IBM compatible and cpm was dying in the wake of the new upstart DOS. I used to be a programmer and teamleader in the computer department of the UK's market leader in it's particular field. Being a self-confessed geek I have built up a lot of machines and spares along the way and although we are talking home network here, I actually have three networks none of which can see the others although some machines are connected to more than one network. One is connected to the internet, one is private, and the other is my MVP media network. I also have a forth one which is not set up at the moment and waiting for my new workshop to be built into which it will be reinstated. The point is that I am fairly familiar with my systems.

I am as stated however a relative newbie to linux and that mainly comes down to different software, command names, and syntax with a few protocols thrown in for good measure. This is what always brings any one of us down to ground level.

Now please please don't take this as being rude or nasty, it really isn't meant to be.

In a case like mine I just need simply help like you gave with the "ls -l" command earlier. Like bluesdog has said there is nearly always more than one way to do something, some suit a person better than others so it's great to hear from your collective experiences what has worked for you and what to try out to overcome a problem.

Thanks bluesdog for the brilliant example which is basically what I eventually did and it's great to have it laid out so that it's easy to follow;

I did use -R in both chown and chmod, covering all bases, in the hope that it would then cover subsequently created directories and files, any experience of whether that works?

Also editting /etc/fstab which I is a permanent file read by the system on bootup, yes? but what about mtab? I was editting that too as mentioned earlier but am I right in thinking that this is actually a volatile file re-created during each bootup from the details in fstab?

Finally, this is a server and I have a problem with network access of shares. Like I said it's a "home" network and private so security isn't such an issue. It wouldn't be too much of a pain to setup different user security levels as I'm the only one who actually creates directories and files on this media server, but that's not the case on the other two servers.

On the Windows machine(s) no passwords were set up and yet sometimes and on some shares logins and passwords are requested. I have never successfully broken this one down. It can happen both to and from a linux machine or a windows machine but isn't always the case. I have tried null passwords, my linux passwords etc. to no avail. It's a pain in the butt. I was going to set up a dedicated "sharer" user as a member of my group, mike and assign a password to it to try and nail it down. Is there anything special in the setup of these mounted drives to control that?
User avatar
LearningCurve
 
Posts: 9
Joined: 2010-02-19 13:19

Re: No permissions to Drive I partitioned?

Postby bluesdog » 2010-02-24 02:36

/etc/fstab is a file which controls the mounting of static partitions
/etc/mtab is a list created by the system, showing the currently mounted paritions. It reads settings from /etc/fstab, and also whenever a partition is mounted explicitly.

To illustrate that /etc/mtab is a dynamic file, compare the date/time string output of
Code: Select all
ls -al /etc/fstab
and
Code: Select all
ls -al /etc/mtab


~~~

If you're setting up server with windows boxes on the network, and want to share folders, use Samba.
It's quite easy to set it up, especially on a local network with few security concerns.
Lots of how-tos available. Basically you set up the Samba server on your Linux machine, designate a folder or folders you want to share; assign whatever user/group/password arrangement you like.
Once that's done, simply look for the network share from the windows boxes.

Windoze has a difficult time understanding file ownership/permissions, whereas that structure is integral to Linux and other Unix-like systems, such as OS X.

gnome-system-tools apparently has a complete set of samba configuration utilities, but it would probably be more beneficial to learn how to configure it from the script level.

Folder ownership determines current and future ownership of its contents, with the exception of anything put there by root, or a user with higher privileges than those of the owner of the folder.

There's no need to setup a special 'sharer' user. If you're using samba, there'll be a default group, 'sambausers', iirc, with access to the folder(s) you assigne to that group.

If you want to get really fancy, you can create additional groups with the groupadd command

~~~

imo, the most challenging part about setting up a Linux based network is understanding the importance of, and interaction between, file/folder ownership, groups, and permissions.
Practise using chown, chgrp, and chmod. Learn how to create users and groups, and how to add/remove/modify them with commans such as useradd, usermod, id

Have fun!
User avatar
bluesdog
 
Posts: 2082
Joined: 2006-02-01 09:02
Location: Similkameen, British Columbia, Canada

Re: No permissions to Drive I partitioned?

Postby LearningCurve » 2010-02-24 06:21

Lovely, thanks.

I have used samba like that but there seem to be issues. The samba shares I set up on my Mandriva box do not appear to be available to a windows box and the windows shares sometimes come and go. I get asked for domain passwords as well.

I have to say I'm not convinced about the networking in Mandriva, it does seem to be a bit erratic.

I am pretty sure of my network setup, very tightly reined in, static IPs all round, routers with dhcp/dns tables set up controlling it all. It's a real minefield though, Windows networking is all very nice keeping everything nicely hidden so as not to confuse it's users, but when it comes to wanting to grab it by the neck and control it manually, you can't. It uses different terminology and still hides the real networking protocols, domain names, etc by referring to them differently. It's like translating from one language to another.

This is yet another reason for wanting to use Linux on the majority of my boxes, control, knowing what everything is setup as which is also better for security of course when there are so many "risks" on the internet.

I think I'll have to look up some command line samba tutorials. It's a shame in a way that when I look at forums, we always seem to end up coming back to the command line. I loved it in DOS but over time you become used to and comfortable with GUIs. Its a shame that when the desktop is a pretty way of accessing the commands, somehow it doesn't have the power and accuracy of the real deal. I guess it's just one step too many.
User avatar
LearningCurve
 
Posts: 9
Joined: 2010-02-19 13:19

Previous

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 11 guests

fashionable