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 |
Quote:
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 |
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 . |
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. |
Quote:
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... |
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 |
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. |
Quote:
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. |
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:
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:
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 |
.
Again, if I knew how to move this to a new thread "Partitions and Directories" I would do so. Quote:
Quote:
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 |
Quote:
What and how you backup depends on your needs. |
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.
|
Quote:
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. |
Quote:
. |
Quote:
. |
All times are GMT -5. The time now is 03:06 AM. |