LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 11-17-2020, 02:48 PM   #1
AnneF
Member
 
Registered: Oct 2020
Location: North Carolina Mountains
Distribution: Just making the switch to Linux
Posts: 78

Rep: Reputation: Disabled
Updates and Separate Partitions for 1st level directories


1, If I have some 1st level directories (such as /usr /tmp or /opt (etc.) on a separate partition, then when I download and install an update, how does Linux know where all the directories are?



2. I am assuming these partitions need to be "mounted" when Linux is run? (I know little at this point) Can this mounting of necessary directories be automated?


Thanx, AnneF
 
Old 11-17-2020, 03:01 PM   #2
quickbreakfast
Member
 
Registered: Oct 2015
Location: northern territory
Distribution: slackware 15
Posts: 335

Rep: Reputation: Disabled
Quote:
Originally Posted by AnneF View Post
2. I am assuming these partitions need to be "mounted" when Linux is run? (I know little at this point) Can this mounting of necessary directories be automated?
All partitions which are listed in your /etc/fstab file are mounted as part of the boot process.

So if you wanted a partition called cat to be mounted automatically all you'd need to do is list it, and the other relevant details, in the /etc/fstab file.

This link https://www.howtogeek.com/444814/how...file-on-linux/ will explain a bit more about the fstab file
 
1 members found this post helpful.
Old 11-17-2020, 04:54 PM   #3
AnneF
Member
 
Registered: Oct 2020
Location: North Carolina Mountains
Distribution: Just making the switch to Linux
Posts: 78

Original Poster
Rep: Reputation: Disabled
Thank you, quickbreakfast. I think I see how that works. I guess I would mount all such 1st level directories in different partitions / where they would normally be? That would just be a pointer/link to the mounted directory, right? The actual data would be stored on the drive/ partition/directory pointed to? The link was quite helpful (and kept leading me on to more adventures).

If I use GParted to create partitions (on my empty HD2 of 500GB)(p1-System, p2-Swap, p3Extended: (pe1-/root,
pe2-/home, pe3-/var,/tmp ...etc. for the directories that I want on different partitions, then you're saying that to get a Ubuntu or Debian/KDE install, to get Linux to recognize any directories on different partitions, I would have to use the command line to put their parameters into fstab? I'm still not sure EXACTLY HOW (syntax) to get the information INTO /etc/fstab, but I understand the principles and understand the elements/columns/output of the lsblk command.

Different topic:
Can Linux be set up as a single-user installation, such that I could use /home as my home directory and not have to insert a redundant username (branch to nowhere) following /home? Like the PERSONAL computer it is, and not encounter any complications (including duplicated sub-directory names)that a business or family computer might encounter?

I've got backup/image questions too, but I'm not there yet, well, other than what directories should be backed up together on the same schedule. I'm still reading about that.

Thanks again, I really appreciate you sharing your knowledge with me. --AnneF
.
 
Old 11-17-2020, 05:25 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,721

Rep: Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914
An common analogy is to compare the linux filesystem with a tree. The trunk is the /root filesystem and that all other filesystems attach to the trunk as branches. Other filesystems attach to /root as mount points which are essentially directories i.e /var or /home. There is a standard to which by convention most distributions implement.

https://en.wikipedia.org/wiki/Filesy...archy_Standard

The system is is /root, /home, /var /tmp together so there is not a need for a separate "System" partition and for someone just making the switch I would keep things simple. I would suggest just /root, /home and swap. Some distributions also automatically create a /boot. You could have a single /home partition for a single user but installers automatically create /home/username and again as a someone just beginning to use linux keep it the same because anyone that would help you on this site would assume that your home is /home/username. By the way there are several command line short cuts so you don't ever need to type in /home/username.

~ is a short cut for /home/username
. is a short cut for PWD (current working directory)
Entering just the command cd will always return you back to your home directory.
 
1 members found this post helpful.
Old 11-17-2020, 06:07 PM   #5
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by AnneF View Post
Different topic:
Can Linux be set up as a single-user installation, such that I could use /home as my home directory and not have to insert a redundant username (branch to nowhere) following /home? Like the PERSONAL computer it is, and not encounter any complications (including duplicated sub-directory names)that a business or family computer might encounter?
There's nothing stopping you from using "/home" as your personal home directory. "/home/anne" would be a more typical configuration. I'd urge you to follow the convention.

A good reason to use something like "/home/anne" would be if you were to install a software package that uses some kind of administrative login for configuring/managing the application. Example: a database package. It's pretty common to want a database administrator account. If you've commandeered "/home" for your personal use then the administrative account for that application has to go somewhere else. Where would you put it if could couldn't use "/home/dba" (or whatever) for it?

There are some long-held UNIX/Linux conventions that make it easier to use. "/home" as a parent for user account home directories is one. I once worked in an environment where a collection of administrators had set up user accounts under "/home" on some systems, under "/users" or "usr/home" on others ... it was a real mess. (You wouldn't believe the way Oracle RDBMS had been installed on those systems.)

Good luck...

Last edited by rnturn; 11-17-2020 at 06:34 PM.
 
1 members found this post helpful.
Old 11-17-2020, 06:42 PM   #6
AnneF
Member
 
Registered: Oct 2020
Location: North Carolina Mountains
Distribution: Just making the switch to Linux
Posts: 78

Original Poster
Rep: Reputation: Disabled
Thank you both for the good advice. I will create a username under /home - it makes more sense to me now. I didn't think anyone would write to /home but me.

Thanks, Michael, for the command line shortcuts. I programmed on Dos & Unix (a bit in C) MANY years ago, but I have used Windows for so long now, I've forgotten nearly everything. At least it's not completely foreign, I guess I should be grateful for that.

I do like separated directory types for making backups and for easier defragmentation and disk maintenance. I'm trying to figure out what makes sense to put where. In Windows, I kept the System (OS, Registry, Installed Pgms) and Data on separate partitions on one HD, and Data backups and System partition image files in separate partitions on a Backup HD. It's never set up easy, though, you have to cherrypick through C (System) for configuration files to add to the Data backups, for apps that don't let you choose where you want profile/configuration files to be kept, so they won't be clobbered (or can be restored) by a restored image file.

I installed Ubuntu 20.04, and it's a bit confusing, because the "folders" don't relate to "directories" and I don't know where things really are, physically or logically. I haven't been able to get my Firefox profile data moved over yet - like 500 passwords and bookmarks. I've got a lot to do and figure out before I can ditch windows.

Thanks again, guys, for the great help, --Anne

Last edited by AnneF; 11-18-2020 at 11:54 AM. Reason: grammar
 
Old 11-17-2020, 08:26 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,721

Rep: Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914
One more comment that linux is not Windows. linux filesystems do not fragment like Windows and having a separate home partition and data does make sense for maintenance. The link I posted shows where program files are located. System configuration files are in /etc/, users configuration files are in their home directories, no registry and nothing spread out like Windows.

Folders are the same as directories but there are no separate c: or d: drives.
 
1 members found this post helpful.
Old 11-17-2020, 08:44 PM   #8
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by AnneF View Post
I installed Ubuntu 20.04, and it's a bit confusing, because the "folders" don't relate to "directories" and I don't know where things really are, physically or logically. I haven't been able to get my Firefox profile data moved over yet - like 500 passwords and bookmarks. I've got a lot to do and figure out before I can ditch windows.

Thanks again, guys, for the great help, --Anne
The easy way is the best way for most people. When you do the install all the needed directories (also known as folders) are created and populated by appropriate system files. Newer installs create / (the root partition) and /home (the users home directory home partition), some create a /boot (boot partition), and most create a swap partition. Usually nothing else is needed. When a user is added (as is done during install or the first login after the install) that users home directory automatically is created as /home/username so you should not need to create the directory, and every time you log in you start there.
Remember this: In Windows a directory is called a folder. In Linux it most often is called a directory but may be referred to as a folder as well. The two words are synonymous for computer users.

Moving data from windows can be problematic because they don't use the clean functional layout that is done in linux. With Chrome you can import most user data including bookmarks and contacts from firefox (although I don't know about the account/password database). Then, because you probably have a google account if you use chrome, that data can easily be transferred to another machine with a chrome browser.

Overthinking things and doing stuff without a real need can cause problems. Use the defined repositories (repos) to download and install packages so things are always compatible with your system. Having the /home/username directory makes it easy to do backups of your data and since all your personal data in whatever form is there that is the only thing that needs backed up for the great majority of users.

The OS and applications can easily be reinstalled if needed. Personal data is easy to backup and restore since it is kept separate from system areas. All is much easier than the M$ environment.

Last edited by computersavvy; 11-17-2020 at 08:52 PM.
 
1 members found this post helpful.
Old 11-18-2020, 11:52 AM   #9
AnneF
Member
 
Registered: Oct 2020
Location: North Carolina Mountains
Distribution: Just making the switch to Linux
Posts: 78

Original Poster
Rep: Reputation: Disabled
If I knew how to move this to a different thread (Firefox profile) I would, but I don't know how yet. I just figured out how to use the "QUOTE" mechanism properly.


Point taken on your great suggestions and I will follow them - thanx.

Quote:
Originally Posted by computersavvy View Post
With Chrome you can import most user data including bookmarks and contacts from firefox (although I don't know about the account/password database). Then, because you probably have a google account if you use chrome, that data can easily be transferred to another machine with a chrome browser.
I'm not using Chrome; I'm using Firefox in Win7, so I'm wanting to transfer my Firefox profile in Win7 to the (identical looking) Firefox profile in Linux (Ubuntu 20.04). Or at least my passwords database (2 files in the profile), which is the most important thing. I have not yet tried replacing JUST those two files, yet.

It seems very odd to me that Firefox has no easy way to import it's own profile.

I've tried a number of methods that don't seem to work, but I wonder if it could be because everything is in RAM since I'm running from a "live" flashdrive. I just thought since I updated something and it looked like the data was there, that it was, although Firefox did not find it when I looked for the password database via Firefox.

Quote:
Originally Posted by computersavvy View Post
Having the /home/username directory makes it easy to do backups of your data and since all your personal data in whatever form is there that is the only thing that needs backed up for the great majority of users.
The thing is, to me, ALL configuration/profile, etc - ANY files into which I have set preferences, etc., - and which might be clobbered (lost) by an update or backup restoration, wherever they are located, are "MY personal data."

My current backup app (2nd Copy) maintains an uncompressed duplicate of my data in a partition on a different HD. In my backup profile, the element that runs first, cherry-picks any config files that reside outside my data HD and copies them to my data HD, so they are then backed up with my personal data and can be restored if an update destroys them.

How could I pick up ALL Linux configuration-type files, wherever they are, to backup with my data? Since I won't have 2nd copy to automate it, am I lucky enough that ALL configuration-type files (system or app) are kept in one (or two) directories, that I could back up along with /home??

--Anne
 
Old 11-18-2020, 12:53 PM   #10
AnneF
Member
 
Registered: Oct 2020
Location: North Carolina Mountains
Distribution: Just making the switch to Linux
Posts: 78

Original Poster
Rep: Reputation: Disabled
.
Again, if I knew how to move this to a new thread "Partitions and Directories" I would do so.

Quote:
Originally Posted by michaelk View Post
...linux filesystems do not fragment like Windows and having a separate home partition and data does make sense for maintenance.

The link I posted shows where program files are located.

System configuration files are in /etc/, users configuration files are in their home directories, no registry and nothing spread out like Windows.
So I could keep /etc in the partition with /home & and backup that partition to be sure I had all the configuration files in the backup?
Quote:
Originally Posted by michaelk View Post
Folders are the same as directories but there are no separate c: or d: drives.
Let me see if I understand this (new concepts to me). Pointers to the partitions are mounted as /dir, right into RAM? so you don't need to refer to anything but the /dir? When you "save" a file, is it "saved" to the actual HD, using the mounted RAM pointer? I'm probably off-the-wall and showing my ignorance - how does this really work, under the hood?

How does Linux backup software work? Does it just back up the source /dir to the mounted target /dir without reference to the partition? I think I'm still confused about this part. If you wanted to restore one specific file from the backup, how would you do that? What does the backup look like and how could you access it?

In windows, if you don't IMAGE the entire partition, you won't get everything, so much is hidden or "in use". You can't reproduce the entire, complete OS partition itself with only File/Folder backups.

But in Linux, to backup or restore a partition, you do not have to IMAGE or CLONE the partition to pick up everything you need to duplicate that partition somewhere else? or to restore an earlier copy of it? If so, yay, that's one of the things I hate about Windows - all the hidden and repeated, meshed together stuff in the registry, requiring a complete IMAGE as a backup. In Linux, the "registry" is visible - it is the /dirs? Nice.
And, to "uninstall" something? Is it pretty much all in one place - or you know where the pieces are? Or the system knows where they are?
How would I backup everything, on all Linux partitions, using the command line? or just one /dir?

Sorry, I'm probably asking too many questions in one place (there is SO MUCH to know, my mind starts racing). If you could just please set me straight where I'm obviously thinking wrong, or point me to relevant references, I would be grateful. Thanks. --Anne
 
Old 11-18-2020, 03:47 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,721

Rep: Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914
Quote:
So I could keep /etc in the partition with /home & and backup that partition to be sure I had all the configuration files in the backup?
No, /etc can not be moved from /root

What and how you backup depends on your needs.
 
1 members found this post helpful.
Old 11-18-2020, 04:42 PM   #12
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
The blessing of Linux is that there are so many choices. The curse of Linux is that there are so many choices. There are many ways to back up a Linux installation. I use a program called timeshift, in the Debian repositories and I believe in most of the major distro repositories. There is also BackInTime, as well as the venerable tar and rsync, and many more. Which to use is your choice, depending on your preferences and needs. It can take some time and effort to learn about all the choices, and what each does, and how, but it's essential that you do, because no one else knows exactly what your needs and preferences are. You've invested years in learning Windows, so it's not unreasonable to expect to spend some time learning about Linux.
 
Old 11-18-2020, 04:56 PM   #13
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by AnneF View Post
So I could keep /etc in the partition with /home & and backup that partition to be sure I had all the configuration files in the backup?
Here and here are a couple places to learn the file system structure and what goes where. Moving things around is likely to break your system. Let the directory tree exist as it is installed and work with your personal data within your home directory (or folder, if you choose to call it that)

As far as backups, and partitions, Linux when it is running has no concept of partitions, only file system structure and content. Mounted partitions are seen as part of the filesystem so except for specific administrative tasks they are irrelevant to everyday operations. Windows treats each partition as a separate thing, linux does not.

One very simple tool that can do backup copies for you is rsync which is a better way to copy files than the old workhorse cp. The man pages for both will tell you the differences. One way to do a full backup of system configs and personal data could be as easy as "sudo rsync -av /etc /home/username /your/backup/directory/". This would copy the /etc directory as well as the /home/username directory and all their content to /your/backup/directory.

There are many other ways to do the backups and rsync is only one of the tools that some use. You can search on the internet to find one that meets your needs and then establish your own backup process. Keeping in mind that system config files are in and under /etc, and personal data and configs are in and under /home/username. All files in the entire system except those in your home directory are related to operation of the OS and installed apps. System configs, once set up to your liking, experience infrequent changes. Personal data, OTOH, changes depending on how you use the system.

As said by michaelk you cannot move things around because the structure is fixed except for what you place under your personal home directory.

Last edited by computersavvy; 11-18-2020 at 04:59 PM.
 
1 members found this post helpful.
Old 11-19-2020, 05:38 PM   #14
AnneF
Member
 
Registered: Oct 2020
Location: North Carolina Mountains
Distribution: Just making the switch to Linux
Posts: 78

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sgosnell View Post
It can take some time and effort to learn about all the choices, and what each does, and how, but it's essential that you do, because no one else knows exactly what your needs and preferences are. You've invested years in learning Windows, so it's not unreasonable to expect to spend some time learning about Linux.
I am definitely spending TIME learning Linux, but then I expected to - I don't like flailing about - I like to have some idea what I'm doing, and without doubt, that takes Time. I am so appreciative of all of you Linux masters who are so generous with YOUR time to help folks like me when we get stuck on a wicket. --Anne
.
 
Old 11-19-2020, 05:44 PM   #15
AnneF
Member
 
Registered: Oct 2020
Location: North Carolina Mountains
Distribution: Just making the switch to Linux
Posts: 78

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
No, /etc can not be moved from /root
What and how you backup depends on your needs.
Thank you. It's so easy to make a non-bootable mistake in a Linux installation. I've been reading about the 1st level directories and most of them should stay in /, There are just a few that should have their own partition. Not done yet, but I'm working on it. --Anne
.
 
  


Reply

Tags
directory, partitions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
My 2nd attempt at a 1st post - the 1st attempt got snafued somehow hawkfeather LinuxQuestions.org Member Intro 1 07-13-2013 04:24 AM
[SOLVED] How to create separate partitions for directories AFTER installing Linux ? Aquarius_Girl Linux - Newbie 14 10-04-2010 05:57 AM
Put a 2nd kanotix at hdb 3/,-4/home. 1st is at hdb8/,-9/home.#2 is using 1st's /home sleekmason Linux - General 3 12-09-2006 09:21 AM
emacs in run level 3 then switch to X (level 7) then back to level 3 dsoliver Slackware 3 09-01-2006 03:31 AM
Separate Partitions for Separate User groups volvic Slackware - Installation 2 09-16-2004 02:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration