Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!

Notices

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

But if you are creating mnt points for individual users then the data isn't shared, it's just additional space that would be there in users directories.
I can understand having an additio.al drive & having read/write permissions, but it appears that the data is no different than an extension of /home/videos or pics.

Thanks EDDY1 for coming,

You are right that the '/home/user' would be useless. However now that I too understood so, after these discussions, I will remove the '/home/user' altogether and change it to mnt/user. I wanted a seperate user's parttion for a seperate user which cannot be accessed by other users except the admin.

And I as the admin will be able to set in such a way that 'user1' will have free access to '/mnt/user1' at startup and will not be able to access even for read, the '/mnt/user2'. And the same for 'user2'.

What is the process to do this?

Quote:

Originally Posted by EDDY1

I would say you wold have to move it to / partition as your users won't be able to login

Please explain. I didn't understand this. Users won't be able to login to what? Their user-accounts i.e. the '/mnt/user' partition? [Since I will not be having a seperate /home partition, and will have instructed the OS to recognize the '/mnt/user' as the default place for user1, the user should get access or should be able logon to his account and partition '/mnt/user', no?]

You would lime / on primary partition
Make sda3 / & put /home in logical or sda4.

No EDDY1, I didn't understand a thing.

Thank you & Regards

--------------------

Hello guys,

I think I should start doing the Partitioning & Installing step by step through your valuable guidance so that my problems are practically discussed instead of asking the 'if' questions. That way I will get to understand better, all the while resolving my practical problems.

There are some cases where a separate boot partition might be useful. Your situation is not one of them so creating a separate /boot partition will unnecessarily complicate things for you. A windows system requires the BOOT FILES to be on a primary partition but the rest of the system files do not need to be. Linux does not require this. Moot point I guess as you already have windows installed.

The purpose of the /home directory is to store user data. You can have personal data there such as documents, videos, music you create or put there but you will also have some configuration files there. The /home/user1 sub-directory is personal to only user1 and of course the root user. In your situation, a user2 would be able to read what is in the /home/user1 sub-directory but not write to any of the files, delete or make changes there or create any new files there. The purpose of the /home directory and its user sub-directories is for personal user data. This is the same whether you have the user directories in the / partition and not a separate partition as well as if you have them on a separate partition.

The purpose of creating directories under /mnt is for shared data, data that user1 and user2 have access to. You indicated earlier that you wanted a separate ntfs directory for your users which would be accessible from windows. That's where you put it. If you leave unallocated space during the installation, it will be much simpler to create these after installing.

In one of your posts above, you suggest creating a partition: 10 GB-- /mnt/user1 - ntfs --------- Logical
If you mean that as a replacement for the /home/user partition, I would not expect that to work but then I have never tried it. If you mean a separate data only partition, it should work. You cannot install any Linux system on an ntfs partition and expect it to work any more than a windows system would work on a Linux filesystem. In that regard, a default windows install cannot even read a Linux filesystem.

If there is currently data on the three separate /home/user partitions, you should move it all to the /home directory first as obviously deleting the partition deletes all the data.

Quote:

I am curious what the purpose of the /data parttion is? If it would be put in the root of the filesystem, I suppose it's contents would surely get deleted in case of a re-installation. If so why create the /data partition?

It is no more "in the root filesystem" than your separate /home partition. If they are on separate partition, reinstalling an operating system won't affect them. A standard installation is going to want to create a /home as a sub-directory of / or as a separate partition. With a separate data partition you just do not select it to install anything to and it will still be there after install. I've done this countless times, no problems.

you will be forced to resize your partitions if one user requires slightly more than 10GB.
If those partitions were combined as a single partition /home/user1 & /home/user2 of total size 20GB then it wouldn't matter if one user wants 15GB (provided the total usage is less than 20 GB).

I am really greatful to you for this painstaking detailed explanation.

Quote:

Originally Posted by yancek

The purpose of the /home directory is to store user data. You can have personal data there such as documents, videos, music you create or put there but you will also have some configuration files there.

I suppose the configuration files are ceated by the OS, and they are the user's custom/preference settings. Now suppose I had to re-install the OS, will the newly installed OS pickup those same old settings i.e. recognize and execute them or will it create its own settings and perform accordingly? Will there be any conflict caused due to the new OS and old settings?

Quote:

Originally Posted by yancek

In your situation, a user2 would be able to read what is in the /home/user1 sub-directory

Can I avoid that? That was one of my main goals. [The others being, One, the exchange of free space between the Unallocated-space and the rest of the partitions, without harming the performance of the system, Two, a scheme of partitions which gives the ability to reinstall OS without loosing the user-Documents & other files.]

Quote:

Originally Posted by yancek

The purpose of the /home directory and its user sub-directories is for personal user data. This is the same whether you have the user directories in the / partition and not a separate partition as well as if you have them on a separate partition.

Point taken.

Quote:

Originally Posted by yancek

The purpose of creating directories under /mnt is for shared data, data that user1 and user2 have access to.

Oh I didn't know that. Then the '/mnt', does not serve my purpose!

Quote:

Originally Posted by yancek

You indicated earlier that you wanted a separate ntfs directory for your users which would be accessible from windows. That's where you put it.

Exactly.

Quote:

Originally Posted by yancek

If you leave unallocated space during the installation, it will be much simpler to create these after installing.

Can a newbie like me deal with a swap-file without complications? Or should I simply stay with the swap-partition? And what should I do about the Swap-partition, if I can keep a swap-file instead? Delete and add it to Unallocated-space?

Quote:

Originally Posted by yancek

In one of your posts above, you suggest creating a partition: 10 GB-- /mnt/user1 - ntfs --------- Logical
If you mean that as a replacement for the /home/user partition, I would not expect that to work but then I have never tried it.

Yes your assesment is right, I meant that as a replacement for the '/home/user' partition.

So it doesn't work.

Then how would I go about? '/data' partition? [as you have mentioned in your post further below]

Quote:

Originally Posted by yancek

If you mean a separate data only partition, it should work.

Does this mean that, if I want to have a 'ntfs-data-only-partition', I should also additionally have, the '/home/user' partition? But that would mean wastage of space, I think? Can we not avoid it? Aren't there any workarounds?

Can the data-only-partition hold all kinds of data, like, Video, Audio, Documents folders and everything else?

Can that data only partition, be made inaccessible to other users, except the owner/operator of that partition [and the Root, that's understood].

Will it be mounted automatically at startup when it's standard-user logs-in, without her/him requiring the Root password?

Does this also imply that; the user access of a data-only-partition can be restricted completely, while the '/home/user' partition cannot be restricted for reading?

Quote:

Originally Posted by yancek

You cannot install any Linux system on an ntfs partition and expect it to work any more than a windows system would work on a Linux filesystem. In that regard, a default windows install cannot even read a Linux filesystem.

Got it,.

Quote:

Originally Posted by yancek

If there is currently data on the three separate /home/user partitions, you should move it all to the /home directory first as obviously deleting the partition deletes all the data.

I did the backup.

Quote:

Originally Posted by yancek

It is no more "in the root filesystem" than your separate /home partition. If they are on separate partition, reinstalling an operating system won't affect them.

Point taken.

Quote:

Originally Posted by yancek

A standard installation is going to want to create a /home as a sub-directory of / or as a separate partition.

I understood that the OS needs a distinct place to keep the configuration files of every user, plus of-course the user generated files. Now if I do not create a seperate partition for '/home', where will the OS place them? In the '/' partition?

Quote:

Originally Posted by yancek

With a separate data partition you just do not select it to install anything to and it will still be there after install. I've done this countless times, no problems.

That's fine then. I could go with that. Then can I create the partitions as below?

If you want to create two usersyou will be forced to resize your partitions if one user requires slightly more than 10GB.
If those partitions were combined as a single partition /home/user1 & /home/user2 of total size 20GB then it wouldn't matter if one user wants 15GB (provided the total usage is less than 20 GB).

I was thinking, that a 'single ntfs partition' for two users cannot restrict access to one another's files. I want that each user's files are not accessible to one another.

You are right in saying that if need be, one user can use more space if both are on the same partition.

However I have discussed and finalised with the users, that each will have equal share of space. And each shall reacieve equal increment/deductions as the need arises. Moreover unless it is for genuine reasons each will not get any increments in space. They will have to do with what they have been allotted.

If you put your /home directory on a separate partition that is the expected behavior. The system files will be on their own (/ or root) partition. Of course, as you said earlier, you would be doing a backup before installing which is wise. Software being what it is, there are just too many possibilities for things to go wrong that a user has no control over. Linux systems being free software, we have no guarantee it will work no should we expect a warranty on anything which is free.

If you do not want one user to even be able to view another users file, that can be done in several ways but I don't believe you can do it during the installation. I'm not sure why you would need it to be that restrictive but if you feel you do, you need to install first. The only thing that comes to mind is encryption of a partition or partitions during install as a possibility, never done that myself.

Quote:

[The others being, One, the exchange of free space between the Unallocated-space and the rest of the partitions, without harming the performance of the system

I don't know what you mean by that. Free/unallocated space is useless until a partition and filesystem are created on it. If you want space that can be shared by users where they all have access to it, yes you can do that and set permissions on it.

Quote:

Two, a scheme of partitions which gives the ability to reinstall OS without loosing the user-Documents & other files.]

I believe that's what we've been talking about here. You create a partition on which you install the system files, the Mount point for it during the installation will be: / which is the symbol for the root, root of the filesystem not the root user. As indicated above, separate partitions for your specific user data is generally in a /home directory and the standard method is to put that on the same partition as / of the filesystem. Creating a separate partition for /home is what you want to do. Creating a separate /home/user1 and /home/user2 partition will not in itself make the partitions less accessible to either user. Set owner:group permissions after install. Reading through your post above, I see I am repeating myself.

The use of the /mnt directory has generally been used for share data, it is a standard practice more than an actual necessity but that is where I would suggest you create mount points for shared data.

I have no suggestion with regard to a swap file rather than a swap partition, never done that so get advice from others. The only thing I would say is that you probably don't need 6GB, if you have 6GB of RAM especially but that may depend upon the uses the computer is put to.

You currently have a 50GB windows partition for your operating system and a 150GB data partition for windows, correct. The rest of the space you show being used as / (for the filesystm) and swap and no mention of /home partition. If you want a separate /home partition, create it during the install. I would think 15-20GB for / would be more than enough unless you plan to install a lot of software. If you are using the standard master boot record (rather than GPT/EFI) partitioning, you will need to create an Extended partition if that does not already exist for the rest of the drive so that you can create your logical partitions within it. Any partitions shown with the fdisk command which are numbered 5 or higher are logical partitions. The fdisk output should show which if any partition is used as Extended.

Using /mnt/user rather than /home/user as a separate partition is something I've never seen before. Another member suggested above that he would not expect it to work. I don't think it would either but I don't know, unchartered waters here. Formatting the /home partition as ntfs would not be a good idea, use a Linux filesystem format, the default would be ext4.

Quote:

Then how would I go about? '/data' partition?

I would not try to do this during an install, especially since you are fairly new to it all. As long as you have space, you can create a partition later. You need a mount point for it which simply means creating a directory, usually under the /mnt directory and then mounting it. That would be done by putting an entry in the /etc/fstab file which is its primary purpose.

The /home/ AND /data partitions can hold any type of data, documents, pictures, music, etc. If you tried to avoid having the separate data partition which you want to share and be accessible from windows, you would need to format ntfs as windows default is incapable of reading a Linux filesystem and if you formatted the /home partition ntfs, I would expect all kinds of problems if it worked at all.

Setting owner:group and rwx permissions is best done after install. The partitions can be mounted at boot with a proper entry in the /etc/fstab file. You can set permissions on a directory, different permissions on a sub-directory of that directory, still different permissions on a file with the sub-directory of the original directory. This is not done in fstab but can be done and again, is something done after the installation. I'm getting a little obtuse here but just trying to say there arent' too many limits on what permissions can be set.

Quote:

I understood that the OS needs a distinct place to keep the configuration files of every user, plus of-course the user generated files. Now if I do not create a seperate partition for '/home', where will the OS place them? In the '/' partition?

Yes. A reinstall would overwrite the /home directories. You can avoid that but it will definitely be more complicated.

The mount point or name of a partition for data can be anything you want and does not need to relate to its contents. It is only something which makes sense for the user. You can create a partition with a mount point of MySecretNSAdata which contains pictures of your cat, or vice versa.

Of course, as you said earlier, you would be doing a backup before installing which is wise. Software being what it is, there are just too many possibilities for things to go wrong that a user has no control over. Linux systems being free software, we have no guarantee it will work no should we expect a warranty on anything which is free.

Yes, I have done the backup and taken precautions against any data loss.

Quote:

Originally Posted by yancek

If you do not want one user to even be able to view another users file, that can be done in several ways but I don't believe you can do it during the installation. I'm not sure why you would need it to be that restrictive but if you feel you do, you need to install first.

Among others, one of the reasons is, I would be giving assignments, to the children, and it would be necessary to prevent them from taking a peep into the other's work, before submission. And another one is I want them to Recognize, and Respect the doctrine of Privacy.

Quote:

Originally Posted by yancek

I don't know what you mean by that. Free/unallocated space is useless until a partition and filesystem are created on it. If you want space that can be shared by users where they all have access to it, yes you can do that and set permissions on it.

I meant to create a 'pool-space' where I could drop-in unused extra space collected from other partitions and take-out and give, space to where it is necessary.

Quote:

Originally Posted by yancek

You create a partition on which you install the system files, the Mount point for it during the installation will be: / which is the symbol for the root, root of the filesystem not the root user.

Confusion clarified, thanks.

Quote:

Originally Posted by yancek

As indicated above, separate partitions for your specific user data is generally in a /home directory and the standard method is to put that on the same partition as / of the filesystem.

However, by putting /home directory on the same partition as / of the filesystem, the the user generated files will be erased in case of a reinstallation of the OS.

Quote:

Originally Posted by yancek

The only thing I would say is that you probably don't need 6GB, if you have 6GB of RAM especially but that may depend upon the uses the computer is put to.

Yes, I too was feeling the same. I have a 3 GB RAM. What could be the ideal size of the Swap parttion for me?

Quote:

Originally Posted by yancek

If you want a separate /home partition, create it during the install.

As discussed earlier, I would like to substitute the'/home' with '/data', partition, if it favors my earlier mentioned reuirements. The '/home' partition won't satisfy those needs.

Quote:

Originally Posted by yancek

I would think 15-20GB for / would be more than enough unless you plan to install a lot of software.

Yes, I would be installing much software. The windows system was almost 40 GB full.

Quote:

Originally Posted by yancek

If you are using the standard master boot record (rather than GPT/EFI) partitioning, you will need to create an Extended partition if that does not already exist for the rest of the drive so that you can create your logical partitions within it.

Till now I have used the MBR. Moreover, I have installed Windows already. So, I think I will continue with MBR. I suppose I cannot do MBR for one part of the disk and GPT for another part.

The current Linux installation which is not working, is on an Extended partition. I will format and do a new install on that. So I can have the logical partitions on it.

Quote:

Originally Posted by yancek

Using /mnt/user rather than /home/user as a separate partition is something I've never seen before. Another member suggested above that he would not expect it to work. I don't think it would either but I don't know, unchartered waters here. Formatting the /home partition as ntfs would not be a good idea, use a Linux filesystem format, the default would be ext4.

Since I am thinking of substituting the '/home' with '/data', can '/data' partition be in ntfs?

Quote:

Originally Posted by yancek

If you tried to avoid having the separate data partition which you want to share and be accessible from windows, you would need to format ntfs as windows default is incapable of reading a Linux filesystem and if you formatted the /home partition ntfs, I would expect all kinds of problems if it worked at all.

I am having one 150 GB ntfs for myself and if I can give two 10 GB ntfs '/data' partitions to the other two users that are automatically mounted and usable without the requirement of the Root password, when the users login, that would satisfy my needs. I will not need another seperate partition to share and be accessible from windows. The ntfs '/data' partitions will be accessible from windows anyway.

Quote:

Originally Posted by yancek

Setting owner:group and rwx permissions is best done after install. The partitions can be mounted at boot with a proper entry in the /etc/fstab file. You can set permissions on a directory, different permissions on a sub-directory of that directory, still different permissions on a file with the sub-directory of the original directory. This is not done in fstab but can be done and again, is something done after the installation.

Point taken.

So now will my scheme of partion look as belows before and after installation?