LinuxQuestions.org
Visit Jeremy's Blog.
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-19-2020, 06:43 PM   #16
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 computersavvy View Post
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.

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.
Your entire post was extremely helpful. I'm beginning to get a picture. Something like the /home directory and /backups could be on separate partitions, or even different HDs as long as they were mounted correctly (I wouldn't want backups on the same HD as the source). /etc is in / and /home could be mounted in /, but how would I name/mount the backup? mount: /home/username/backups/.... into / also? Or mount /username/backups... into the /home directory? If so, how to make a mount point there?

What I would end up with in the backup is just a duplicate of /etc, and /home - just those two directories and their contents? Does rsync actually SYNC the target with the source - that is, overwrite any changed files, add new files, and delete files from the /backup directories that have been deleted from the source - to bring the backup into an exact match to the source, or does it just overwrite each entire target directory with the source directory? My 'backup' directory would just be a duplicate of all the directories in my system (except things like /swap of course)? Assuming I backed up all the directories to /backup. /backup would need to be on a quite large partition by itself, assuming it is uncompressed. Can it be encrypted? OMG - this is SO much cleaner than Windows!
.

Last edited by AnneF; 11-19-2020 at 06:49 PM. Reason: Added a line & a space
 
Old 11-19-2020, 10:53 PM   #17
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
/home can be on a separate partition or drive, and that's not uncommon. It's actually very handy, allowing you to save your files if you have do do a reinstall. Naming is your choice, as is the mountpoint for everything.

Rsync overwrites changed files and adds new files, but it doesn't delete anything unless told to do so. It will if you tell it to. Backup options are very much dependent on the wants and needs of the user. You can back up everything, or just some things, depending on what you want. As I've said, I like timeshift for backing up my system. It runs at night, and backs up everything except what I've told it to ignore, which is a lot. In /home, I don't back up .cache and some other folders I already have backed up elsewhere. Under /, I don't back up /run, /var, /tmp, /mnt, /media, /boot, /boot/efi, nor /root/timeshift. Everything else is backed up to an external drive. Timeshift uses links, so the backups don't grow so much, and keeping 7 or so backups takes little more space than one. I currently have 8 backups, including a monthly and two weeklies, and the total is ~220GB. It uses an external 1TB drive as needed, no need for a special partition. If you prefer rsync, that's certainly an option, and it doesn't need a special partition either, just a drive/directories. Of course you're free to make a partition just for backups if you want.

Anything can be encrypted. You can encrypt your entire system if you want, or individual drives or partitions. Just be aware that encrypting destroys all data on the drive/partition/folder, irrevocably and absolutely. Anything you don't want to lose needs to be backed up first and then restored after encryption. There are also multiple ways to encrypt - dm-crypt, LUKS, veracrypt, and probably others. Each has its advantages and disadvantages. Encryption is a very big subject, and needs careful investigation before beginning.
 
1 members found this post helpful.
Old 11-20-2020, 11:52 AM   #18
AnneF
Member
 
Registered: Oct 2020
Location: North Carolina Mountains
Distribution: Just making the switch to Linux
Posts: 78

Original Poster
Rep: Reputation: Disabled
Your entire post is so helpful in filling in blanks in the picture I'm building. I like Linux more everytime I learn something new.
Quote:
Originally Posted by sgosnell View Post
/home can be on a separate partition or drive, and that's not uncommon. It's actually very handy, allowing you to save your files if you have do do a reinstall. Naming is your choice, as is the mount point for everything.
Would it be better to mount in / (with a longer path) or to mount in /home (with a shorter path)? How exactly would I create a mount point in /home for a backup partition on a different HD?

Quote:
Originally Posted by sgosnell View Post
Rsync overwrites changed files and adds new files, but it doesn't delete anything unless told to do so. It will if you tell it to.
I looked up rsync and also found grsync, which would be less error prone to typos for me with script creating/editing. I watched one video, but there are more. Thank you for that direction. Q. So we don't talk partitions here either, just directories - so nice & clean. A backup directory on an external drive could look like /BKUPS/date/sys/ and (/(BKPS/date)/MyData/ ??? The last slash would include sub-directories?

Quote:
Originally Posted by sgosnell View Post
I like timeshift for backing up my system. It runs at night, and backs up everything except what I've told it to ignore, which is a lot. In /home, I don't back up .cache and some other folders I already have backed up elsewhere. Under /, I don't back up /run, /var, /tmp, /mnt, /media, /boot, /boot/efi, nor /root/timeshift. Everything else is backed up to an external drive. Timeshift uses links, so the backups don't grow so much, and keeping 7 or so backups takes little more space than one.
I looked at TimeShift too. So you just keep adding incremental backups by date? Is there a way to consolidate them into the base backup at some time? Or do you have to completely copy everything again to start a new base? You said you keep 7 or so, so there must be a way to add all those changes into the base at some point, unless the after-base backups are differential backups, instead of incremental backups, so you'd just need the first (base) and the last differential backup & could delete any in-between differentials that became irrelevant. I just assumed incremental - maybe I was wrong? Differential would actually be better, because you wouldn't have to keep EVERYTHING, just those that represented significant restore points. (I keep a diary file about every change/install/configuration that I make that affect the system (not data), with separators where I make backups, so if I restore a backup at a point in time, I know exactly what to do to get back to where I was. That would work best with differential backups. I would just delete or grey out the deleted differential's heading, like I never made it. With the differential backup, you only need 2 files to restore, the base and any ONE appropriate differential. Sorry, carried away & thinking out loud.

Quote:
Originally Posted by sgosnell View Post
Anything can be encrypted. You can encrypt your entire system if you want, or individual drives or partitions. Just be aware that encrypting destroys all data on the drive/partition/folder, irrevocably and absolutely. Anything you don't want to lose needs to be backed up first and then restored after encryption. There are also multiple ways to encrypt - dm-crypt, LUKS, veracrypt, and probably others. Each has its advantages and disadvantages. Encryption is a very big subject, and needs careful investigation before beginning.
I'll look all these up. Thank you. These can be used to encrypt directories, right? What do you use to zip/encrypt individual files? I got a nasty surprise when I found out that WinZip didn't clean out it's work folders when it finished zipping/unzipping encrypted files. I thought the files were safe, but they were just sitting (unzipped/unencrypted) out there, somewhere else - temp or work folder, whatever WinZip uses. I discovered this when they said their "new version" cleaned up all it's work files, which apparently it had NOT been doing all these years while I didn't know where they were so I couldn't clean them up either.

It sounds like it might be best to encrypt individual files (7-zip?) so they are also encrypted in the backup, but nothing is encrypted that doesn't need to be.

Thank you, thank you, thank you - for helping me fill in the holes in my slowly emerging picture. Linux is SO much cleaner and understandable than Windows. --Anne
.
 
Old 11-20-2020, 12:10 PM   #19
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
Might not need to be said but if this is for a desktop, don't overcomplicate things. A separate /home partition, or even drive as sgosnell suggested is an excellent idea. I always ran with a separate drive for /home. I also used whatever default partitions the OS installer went with and never made any of them separate partitions. Did that for 20 years and never had an issue. Requirements for servers are vastly different so separate partitions can be very useful there.

I can't speak to encryption because I have never had an encrypted Linux system so others can better advise you there.
 
Old 11-20-2020, 12:37 PM   #20
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
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.
I recall having a similar problem when I migrated from Firefox to Chrome. (I've since moved back to Firefox.) I never found a way -- if one actually exists -- to migrate passwords from one browser to the other. I resorted to doing screen dumps of the passwords in FF and re-keying them into Chrome. I half-suspect that making it a major pain-in-the-neck to migrate your passwords is the browser folk's way of locking you into their software. After doing that process once and vowing to find a way from having to do it again, I wound up downloading KeyPassXC (recommended to me by a co-worker some years ago) and standardized on that as my password vault instead of relying on the browsers. I did re-key the passwords one more time but into KeyPassXC's database---then I deleted all the passwords in the browser. Now the only hassle I might encounter if I were to switch browsers is how to migrate bookmarks and, so far, none have made that an impossible task. Making a copy of the KeyPassXC database from my desktop to my laptop involved a simple sftp command. I Just have to remember to keep the two in sync.

HTH...
 
1 members found this post helpful.
Old 11-20-2020, 01:17 PM   #21
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.
Sorry Michael, I meant /opt, not /etc, but the more I learn, the more directories I see that should stay right where they are, except maybe for /swap /boot /home /opt and /var, for maintenance (backup, fragmentation, etc.) reasons. Does that sound reasonable? Thanks. --Anne

Is your last name Kinney, by any chance? I know a super-smart electronic engineer / systems programmer named Michael Kinney who worked for Siemens when I did a bit of free-lance C programming for them back in the past century. He told me that his boss carried my documentation around to his employees, saying "THIS is what documentation should look like". Made my day. That wouldn't be you, would it?
.
 
Old 11-20-2020, 01:36 PM   #22
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,721

Rep: Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914
Nope. I am an electronic engineer but not super smart...

Forget fragmentation, it isn't a problem with linux filesystems. It depends on what software you install but /opt is rarely used so a separate partition is not necessary. In my opinion you do not need a separate /opt or /var but it depends on what software you install.

The convention is to mount filesystems not associated with the OS to /mnt or /media. In reality you can mount a filesystem almost anywhere.
 
Old 11-20-2020, 01:52 PM   #23
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 rnturn View Post
I wound up downloading KeyPassXC (recommended to me by a co-worker some years ago) and standardized on that as my password vault instead of relying on the browsers. HTH...
Thank you for letting me know about KeyPassXC - that is a good reason to have a browser-independent Password Manager.

The reason I'm trying to keep Firefox is that I think it is the safest, least intrusive browser (Google/Chrome scare me with their excessive tracking and personal data collection/sharing), and I really like the way the Password Manager works (except for migration, of course), but I just found out that Firefox has supposedly fixed that problem in the latest version (80+) by now IMporting .csv files as well as exporting them. (I haven't tried it yet, so I don't know if it works - or if it applies to Firefox Linux). I'll be back to post when I find out.

The biggest reason I use Firefox for passwords is that you can open Firefox, enter your Master Password and it will fill in your logins automatically, but will do NOTHING ELSE! You cannot VIEW or COPY or EDIT any passwords until you open a browser tab for Password Maintenance and ENTER the password AGAIN. You can then View, etc. passwords UNTIL you close that TAB - HOWEVER, it will still continue to fill in your login passwords until you close the browser itself (but your passwords are now still hidden from view).

I haven't found another PM that will do that (Roboform used to, but sadly, no more), they just suggest automatically logging out of the PM every few seconds/minutes, which means when you want to just fill in a login, you have to enter the Master Password again, nearly every time, which is pretty inconvenient, or leave the PM wide open with all your passwords in full view, if you want it to fill in logins automatically & conveniently.

Does KeyPassXC make you open a maintenance tab and enter another password if you want to actually SEE the passwords? I might change over if I could find another PM that would do that. I don't like the difficulty, in Firefox, of getting a pdf /printout to keep in my safe or encrypted in my backups. How do you like KeyPassXC compared to Firefox? --Anne
.

Last edited by AnneF; 11-20-2020 at 01:56 PM. Reason: added sentence
 
Old 11-20-2020, 02:02 PM   #24
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
Keep in mind that browser based password managers are accessible by the browser application process while running. If a nefarious web site can access the browser password DB, they can grab your passwords. I am not saying this is possible as I have not researched it. I never use browser based password storage because as a paranoid security guy, it makes me nervous.

Separate password databases such as KeepassXC keep everything neatly separated. I always copy/paste passwords into sites but having said that, some applications have access to the copy/paste buffers as well. Without going down that rabbit hole, I would say overall, separate password managers such as KeepassXC are safer overall than browser based password management.

Security is never convenient.
 
Old 11-20-2020, 02:15 PM   #25
quickbreakfast
Member
 
Registered: Oct 2015
Location: northern territory
Distribution: slackware 15
Posts: 335

Rep: Reputation: Disabled
I would have posted yesterday, only the thread is marked solved. So I thought you had moved on.

Quote:
Originally Posted by AnneF View Post
Your entire post was extremely helpful. I'm beginning to get a picture. Something like the /home directory and /backups could be on separate partitions, or even different HDs as long as they were mounted correctly.
Your, or anybody's, home partition can be on a separate partition or HDD ...... To have it mount during the boot process the partition need to be included in the /etc/fstab file.

Quote:
(I wouldn't want backups on the same HD as the source). /etc is in / and /home could be mounted in /, but how would I name/mount the backup?
The backup HDD should be on a separate (external) drive.

If it is not on an external drive and the computer's HDD dies, then your backup also rests in peace.

You can use the mount command to mount your external/backup HDD, or when connected, clicking on it in the file manager usually mounts the backup. And the address of the backup, is often to be found in the address box of the file manager.

My data are in folders called /dog and /elephant and /cat (all of which are listed in the /etc/fstab file) so mount at boot time...... two of the three are on separate drives. The third is on a separate partition of the /root drive (HDD)...... and I'll explain more after you install a distro.

My external back up HDD adress is something like /run/media/mine/olga

Quote:
What I would end up with in the backup is just a duplicate of /etc, and /home - just those two directories and their contents?
What you backup is entirely your choice. If you tell your electronic marvel backup your /home folder, then that is, usually, exactly what it does and nothing more. If you want to back up your /etc and /home folders then using two commands that is exactly what the electronic marvel does.

BTW it is usually quicker to create the original back up using the copy command than using rsync.

Quote:
Does rsync actually SYNC the target with the source - that is, overwrite any changed files, add new files, and delete files from the /backup directories that have been deleted from the source - to bring the backup into an exact match to the source, or does it just overwrite each entire target directory with the source directory? My 'backup' directory would just be a duplicate of all the directories in my system (except things like /swap of course)?
Yes your backup is a copy of what you last backedup. So keep the backup current. (I recommend at least weekly).

This here link https://www.howtogeek.com/427480/how...-linux-system/ will tell you more about how to back up your data.

Of course if you want more detail than is provided by the above link type
Code:
 man rsync
type q when you have read enuff..... you might need to have a distro installed to read a man page (a live distro might give you the man page).

Yesterday or the day before you asked about not having the drivers for your electronic marvel. Unless the hardware is new there is often a way to get the hardware to run. Just pop across to the hardware sub forum of this site and ask. Someone there is likely to be able to help.

Last edited by quickbreakfast; 11-20-2020 at 02:22 PM.
 
Old 11-20-2020, 02:20 PM   #26
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 looked up rsync and also found grsync, which would be less error prone to typos for me with script creating/editing. I watched one video, but there are more. Thank you for that direction. Q. So we don't talk partitions here either, just directories - so nice & clean. A backup directory on an external drive could look like /BKUPS/date/sys/ and (/(BKPS/date)/MyData/ ??? The last slash would include sub-directories?
As mentioned, you should not (and in most cases cannot without breaking things) try to relocate any of the directories the installer creates -- especially the subdirectories of /. You can add new directories in /, (most people don't) but should never change anything already there.

FWIW, you can create a mount point almost anywhere you choose to use for mounting your backup disk to. Commonly people use /mnt which the system creates automatically or a subdirectory there (such as /mnt/backup) which they create for that purpose, but it literally can be almost anywhere you choose. A mount point is nothing more than a directory that you create for attaching a device to the filesystem. If you are backing up your users home directory (/home/username) and you have created a subdirectory there (/home/username/backups) that is used to mount your backup disk it is quite easy, but you will have to exclude that subdirectory from the backup or it might either error or get locked into a loop constantly trying to backup the ever changing backup.

One thing you always need to be aware of is that linux is case sensitive and most people use lower case and no spaces in file and directory names because the space causes other problems. I have yet to see a single command in Linux that is anything other than lower case. User names also MUST start with a lower-case letter. Windows from the beginning was not case sensitive (earlier versions always used upper-case for file and directory names) and users have gotten used to having things in upper-case and using spaces so that is one more thing that has a learning curve when you switch.
 
Old 11-20-2020, 05:06 PM   #27
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,832
Blog Entries: 17

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
Quote:
Originally Posted by AnneF View Post
It seems very odd to me that Firefox has no easy way to import it's own profile.
Firefox profiles is a right mess. Before it was easy to manage bookmarks and settings and use these across systems. Trying to copy profile content is just messy and often does not work properly.

It's terrible frankly. But that's the fault of Mozilla.

Quote:
Originally Posted by michaelk View Post
Nope. I am an electronic engineer but not super smart...

Forget fragmentation, it isn't a problem with linux filesystems. It depends on what software you install but /opt is rarely used so a separate partition is not necessary. In my opinion you do not need a separate /opt or /var but it depends on what software you install.

The convention is to mount filesystems not associated with the OS to /mnt or /media. In reality you can mount a filesystem almost anywhere.
I actually use /opt.. Guess that makes me one of the odd ones out.. I even have it as an own partition, this is how "important" my /opt usage is..

Last edited by zeebra; 11-20-2020 at 05:19 PM.
 
Old 11-20-2020, 05:10 PM   #28
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,832
Blog Entries: 17

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
Quote:
Originally Posted by AnneF View Post
Your entire post was extremely helpful. I'm beginning to get a picture. Something like the /home directory and /backups could be on separate partitions, or even different HDs as long as they were mounted correctly (I wouldn't want backups on the same HD as the source). /etc is in / and /home could be mounted in /, but how would I name/mount the backup? mount: /home/username/backups/.... into / also? Or mount /username/backups... into the /home directory? If so, how to make a mount point there?

What I would end up with in the backup is just a duplicate of /etc, and /home - just those two directories and their contents? Does rsync actually SYNC the target with the source - that is, overwrite any changed files, add new files, and delete files from the /backup directories that have been deleted from the source - to bring the backup into an exact match to the source, or does it just overwrite each entire target directory with the source directory? My 'backup' directory would just be a duplicate of all the directories in my system (except things like /swap of course)? Assuming I backed up all the directories to /backup. /backup would need to be on a quite large partition by itself, assuming it is uncompressed. Can it be encrypted? OMG - this is SO much cleaner than Windows!
.
I would advice you try to keep things simple for now.. The only thing you REALLY need to backup is /home! And the way to do backup, is to back it up to a system which is not the same, ergo, disks which are not the same, and not on the same system. (ex, lightening hits your system and breaks all the disks, backup breaks..)

Basically this means that you backup your /home folder to a USB disk of some sort. There are so many different methods to do backup, but it really comes down to how important your data is, how confidential it is and how convenient you want your backup process to be.

Regarding encryption there are also many ways to go about this. But a convenient way is to have a fully encrypted external disk as a backup disk. But then again, a safe backup should not be encrypted, unless data is highly confidential. If the disk or partiton table breaks, there is no way to recover encrypted backup. That's I guess where raid comes in handy. It really depends on your needs. Pretty much endless options are available, but you need to find the right ones for you.

Last edited by zeebra; 11-20-2020 at 05:23 PM.
 
1 members found this post helpful.
  


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 03:49 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