LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint
User Name
Password
Linux Mint This forum is for the discussion of Linux Mint.

Notices


Reply
  Search this Thread
Old 03-03-2023, 08:53 PM   #1
DoctorWizard
Member
 
Registered: Feb 2019
Location: Orange Park, FL
Distribution: Mint 20.3
Posts: 43

Rep: Reputation: Disabled
Reusing configs on a distro change


I am debating doing a major distro change, from Mint to Red Hat which I realize are very different and my Linux skills are not great. My /home folder is on a separate partition so not worried about that. But I'm wondering how much of my old configuration I may be able to save and reuse. Hoping not to have to set everything up all over again from scratch. Hoping to salvage all the user accounts and privileges (doubtful), samba, and fstab (more optimistic).
I'm assuming (correctly?) this is all under /etc.
Realistically, what I can I expect to reuse?

Reason for possibly switching is an issue I have been trying to resolve for at least 2 years, unsuccessfully, despite numerous posts (and replies and suggestions) not only on this forum but several others as well. I'm at my wits end. I may have to 😱 go back to Windows. (See my post "Disappearing Music and Video files" under the "Servers" topic)
 
Old 03-04-2023, 12:39 AM   #2
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
I'm at my wits end. I may have to go back to Windows
Desperate enough to threaten the Linux community.
What would the Linux community be loosing if you were to stop using Linux?
Quote:
Was a Windoze developer for 30 years
Quote:
In a nut shell, files keep disappearing, entire drives worth! But here's the weird part: It's only on my music and video drives. The other drives with other types of files never have an issue. It is not the drives as they have been swapped more times than I can count. They've included brand new WD Blue, Black, and Red in 3TB and 4TB, and Seagate IronWolf, Barracuda, and Firecuda in 3TB, 4TB, and 6TB. So it's neither the brand nor the size. (One of the other drives that never screws up is also a WD 4TB and was formerly the videos drive). They have been plugged into each of the 6 SATA ports on the motherboard as well as 4 more on a PCI card. So its not the port or cables. They've been formatted BTRFS, Ext4, and NTFS so its not the format.
Not to hard to figure out.
I've rebuilt many hair pulling home computer systems, at least 90% of them had something in common:

The user spent most of their free time at porn sites and the videos they downloaded were loaded with malware.
It is now uncommon for downloaded music files to be loaded with malware also.
 
Old 03-04-2023, 10:07 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Quote:
Originally Posted by DoctorWizard View Post
Hoping not to have to set everything up all over again from scratch. Hoping to salvage all the user accounts and privileges (doubtful), samba, and fstab (more optimistic).
I'm assuming (correctly?) this is all under /etc.
Realistically, what I can I expect to reuse?
You should certainly make a security copy of your /etc directory. In fact I always do that before a distro upgrade. Let the installer create its own files, then just edit in any saved information that you want to carry over. For example, if you have special user accounts, you can display the old passwd and group files, copy the relevant lines and simply paste them at the end of the new files. Just check that you aren't inadvertantly duplicating a UID!
 
1 members found this post helpful.
Old 03-04-2023, 08:21 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
I would back up only the files from /etc that you have modified. It's just my opinion, but I see little reason to back up configuration files which have been left at default.

But that's just me.
 
1 members found this post helpful.
Old 03-04-2023, 09:26 PM   #5
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by DoctorWizard View Post
Hoping to salvage all the user accounts and privileges (doubtful), samba, and fstab (more optimistic).
One problem that you may have is with your user ID numbers. The user ID used at login and in file ownership is a number not a name. All distributions set root to ID 0. The other users are given numbers starting with some base number and adding one as each user is added. I think that Red Hat starts assigning user ID numbers at 1000. I don't know what number Mint starts with. If you install Red Hat and create the same user names that you used in Mint you might run into the problem that the Red Hat users cannot access the files that they owned while using Mint because the two distributions use different numbers to assign user IDs. Red Hat would think that the file UIDs belong to non existent users. If that happens then as root you can use the chown and chgrp commands to change the ownership names and groups in all the user files to be the same as they were in Mint.

I took a look again at your post, "Dissapearing music and video files (but no others)" and think that a mismatch between user names and UIDs might be the problem with your music and video files. Two years ago did you do some sort of install that might have left your music and video files with UIDs which do not correspond to their user names?


Quote:
Originally Posted by DoctorWizard View Post
The trigger seems to be writing or moving files, although it has happened when (to the best of knowledge) nothing has been written or moved, simply reading them. It is as I said, intermittent, it happens on maybe or roughly 1 in every 40 writes. Some times it may work for weeks and I may perform hundreds of writes without a problem. Sometimes it happens after a few minutes with almost every copy or move. The fix usually is to simply reboot it. But occasionally that does not bring the stuff back, and no recovery utility I have tried to date has been able to find my files and so I have to reformat and restore from backup.
Possibly when you move files you end up with different UIDs in different files. Reformatting and restoring would probably cure that. I don't know how Windows handles UIDs if at all. If you are sometimes writing the files in question from Windows and sometimes in Linux that could be a source of the problem.

This link could help you diagnose the problem if it is UIDs:
https://vitux.com/find-uid-ubuntu/

Last edited by jailbait; 03-04-2023 at 09:30 PM.
 
1 members found this post helpful.
Old 03-04-2023, 10:20 PM   #6
DoctorWizard
Member
 
Registered: Feb 2019
Location: Orange Park, FL
Distribution: Mint 20.3
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Brains View Post
Desperate enough to threaten the Linux community.
Not a threat, to you guys anyway. More like to myself.

Quote:
The user spent most of their free time at porn sites and the videos they downloaded were loaded with malware.
It is now uncommon for downloaded music files to be loaded with malware also.
  • Absolutely ZERO porn, well on that machine anyway, it's accessible to the whole family.
  • I can't honestly say that I've never ever pirated anything, but I am a very strong believer that the artists should get paid for their work. The great majority of the music and shows on this server have been ripped myself from my own or my family's collections of CDs, DVDs, and BluRays. (I own, as of yesterday, 1991 music CDs and my sister has a sizeable collection as well.) Nearly all the rest is public domain from reputable sources.
  • Music and videos do not execute. They can be intentionally and maliciously corrupted in such a way as to crash the codec used to play them back, and in theory can cause a buffer overrun and then in turn arbitrary code execution. "In theory" and "arbitrary" are key here as it is nearly impossible to do, at least with any degree of reliability, anywhere beyond a carefully controlled setting. So nearly impossible that the CVE database does not list any known exploits of this nature in the wild going back for more than 5 years (just checked). (Crashing the player and codec, yes, many many of them. Code execution, none.) And I have never, ever, seen an anti-virus program flag a music or video file, unless the extension is wrong in which case it will neither play nor execute. Infections from music or video files, including but not limited to porn, is effectively impossible because of how they work "under the hood". Don't blame you for thinking that as it is an often mis-stated by people who should know better.
  • We're talking about the file server here, which just hosts the files and does not actually play them.
  • The accusations of malfeasance against the porn sites is (mostly) unfounded, particularly for the last 10-15 years. They want paying repeat customers and they want no trouble from the banks to collect the credit card payments. Effing up the customer's machine or making unauthorized charges will quickly put a stop to that. And for that reason the sites tend to police each other and report bad actors. That industry is far more organized than you would likely expect.
  • I have cleaned hundreds of malware 'infections' from people's machines. For many years now I have not seen anything that truly meets the definition of a virus or worm. Mainly browser hijacks, along with some PUPs and bloatware. Some of the hijacks can be quite clever and difficult to remove, the majority are not. But no browsing is done on the server.
  • It's a Linux server. Sure, malware exists for Linux but is rather rare. Not enough market share for the hackers and better O/S security. (Another reason for migrating from Windows, but mostly Microsoft's bad behavior as of late.) All Windows computers and Android phones in our network have up-to-date antivirus. I carefully monitor all traffic.
I have worked in the IT industry my entire career. Hardware, software, networking, and administration. I have lived and breathed computers from the time I wake up until I go to bed for 53 years now. Wizard is my actual real name (I swear!) and I try very hard to live up to it. I have more dang degrees and certifications than many people can count (OK, many are expired now that I'm retired). When it comes to computers at least, I am correct 99.99% of the time (nobody's perfect). I know a lot about computers but certainly not everything and when I don't know the answer to something I will admit it. And then research it. Just as I researched the CVE database a few minutes ago.

Note: Upon reading back my own post I see it sounds rather inflammatory. My apologies, that was not the intention. Just listing the seven reasons that I KNOW this is not due to a corrupted/malicious music or video file.

Last edited by DoctorWizard; 03-04-2023 at 10:25 PM.
 
Old 03-04-2023, 10:54 PM   #7
DoctorWizard
Member
 
Registered: Feb 2019
Location: Orange Park, FL
Distribution: Mint 20.3
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jailbait View Post
One problem that you may have is with your user ID numbers. The user ID used at login and in file ownership is a number not a name. All distributions set root to ID 0. The other users are given numbers starting with some base number and adding one as each user is added. I think that Red Hat starts assigning user ID numbers at 1000. I don't know what number Mint starts with. If you install Red Hat and create the same user names that you used in Mint you might run into the problem that the Red Hat users cannot access the files that they owned while using Mint because the two distributions use different numbers to assign user IDs. Red Hat would think that the file UIDs belong to non existent users. If that happens then as root you can use the chown and chgrp commands to change the ownership names and groups in all the user files to be the same as they were in Mint.
I took a look again at your post, "Dissapearing music and video files (but no others)" and think that a mismatch between user names and UIDs might be the problem with your music and video files. Two years ago did you do some sort of install that might have left your music and video files with UIDs which do not correspond to their user names?
Possibly when you move files you end up with different UIDs in different files. Reformatting and restoring would probably cure that. I don't know how Windows handles UIDs if at all. If you are sometimes writing the files in question from Windows and sometimes in Linux that could be a source of the problem.
Well as I understand it at least, I don't see how any of those may be the problem because as I said, the drives have been replaced a bunch of times and I have been forced to reformat and restore backups many times. I didn't mention it over there but I have done plenty of chowns and chmods to get everything correct. Even have a script I run on occasion to make sure they stay that way. Also note the variety of file systems. User IDs (and names) are "final" and have not been changed since I first set it up.
As for Windows vs. Linux (vs. Android and vs. Smart TVs) I certainly HOPE that's not the problem! Countless Linux servers out there are feeding and receiving files to/from countless Windows clients around the world, and occasionally the other way around (Win => Linux) and have been doing so for many many years. Again note the various file systems including NTFS. So it's very unlikely but I won't rule it out completely and if you have suggestions on how to check, and better yet, FIX that, I'm up for some education.

(FYI: Running the chown/chmod script does not correlate or coincide with any drive crashes.)
 
Old 03-04-2023, 11:28 PM   #8
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Well, I run from sexual opportunities so believe me when I say "I don't do porn" as I'm not into that in any way form or fashion.

I have done digital forensics and there is a definite connection between porn or porn sites and misbehaving or poorly performing computers. Most folks asking for help with these computers try to hide their activities, but can't hide nothing from me. The work I do cleaning them up is free, just helping out friends and family.

Based on your other thread, it don't appear hardware related that's for sure. But I have seen this exact behavior, however in your case it is narrowed down to media files where in other cases I have experienced this is with drives containing endless file types. I have seen cases where the missing data was on a separate data drive and reinstalling Windows had those files reappear. Since it's no secret malware is attracted to Windows OS and malware can be designed to be triggered by other events like when a media player is executed etc.

Sorry for repeating myself, there is a definite connection between porn, or porn site visits and misbehaving computers. If your looking for malware, look no further.

I lost 75% of my backed up data on a separate NTFS formatted data drive not too long ago. The drive was mounted manually with ntfs-3g from a non-Linux unix operating system, I forgot to unmount it before shutdown and that was the straw the broke the Data drive's back. Happened a couple times, then I rigged up a graphical script with whiptail for mounting and unmounting drives that would warn me if there was a drive I mounted manually still mounted when I go to shutdown or reboot. Users could not write to NTFS drives when mounted through fstab, strict policies, but writable if mounted manually as root. For me, that has never happened with Linux and ntfs-3g, but I have not used Linux Mint much which is based on my staple Linux OS Debian.

What file system is your media drives using? Might be a NTFS issue.

Last edited by Brains; 03-04-2023 at 11:32 PM.
 
Old 03-06-2023, 04:14 PM   #9
DoctorWizard
Member
 
Registered: Feb 2019
Location: Orange Park, FL
Distribution: Mint 20.3
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Brains View Post
there is a definite connection between porn, or porn site visits and misbehaving computers.
But how much of that have you seen lately? That was certainly an issue many years ago, I saw that countless times myself--- back then. Forensics is not my strongest skill, but I know enough, that I usually attempt to find where an issue came from to mitigate it in the future. The whole security landscape has improved significantly and I see far less 'infections' than I used to. Browser hijacks are now the biggest problem (that I've seen lately) and a good percentage of them originate with 'coupon' extensions. And I know quite a few users that are prolific downloaders of erotica. Also know a person who until recently was operating a number of porn sites and I was amazed at how organized that 'profession' is. They don't want any negative attention and go to great lengths to police their own ranks and track down and shut down the bad actors which are attracted to the biz because they don't think users will complain about their misdeeds. They are correct on that aspect but they don't expect how aggressively the 'legitimate' site owners will attack them. I suppose if someone is surfing the dark web for kiddie porn the situation may be different.
[Clarification] Misconfigurations are the majority of my service calls now, and a few hardware failures. Hijacks would be the majority of the 'infection' issues, which are becoming rarer. But what you fix most would depend on your clientele.

We have certainly gotten off topic here...
 
Old 03-06-2023, 05:16 PM   #10
DoctorWizard
Member
 
Registered: Feb 2019
Location: Orange Park, FL
Distribution: Mint 20.3
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Brains View Post
I lost 75% of my backed up data on a separate NTFS formatted data drive not too long ago. The drive was mounted manually with ntfs-3g from a non-Linux unix operating system, I forgot to unmount it before shutdown and that was the straw the broke the Data drive's back. Happened a couple times, then I rigged up a graphical script with whiptail for mounting and unmounting drives that would warn me if there was a drive I mounted manually still mounted when I go to shutdown or reboot. Users could not write to NTFS drives when mounted through fstab, strict policies, but writable if mounted manually as root. For me, that has never happened with Linux and ntfs-3g, but I have not used Linux Mint much which is based on my staple Linux OS Debian.
What file system is your media drives using? Might be a NTFS issue.
Hmmm, that's an interesting point. Initially all the drives were btrfs. When I kept having trouble with music and videos, I redid them all as ext4. Although btrfs is (supposedly) very stable nowadays, it has nowhere near the documentation, troubleshooting info, or diagnostic and recovery utilities that ext4 does. And then when I continued to have trouble, I switched just the music drive to NTFS being as most of the clients accessing that are Windows based. Videos are more of a mix, with Windows, Linux, embedded Linux (Smart TVs and streamer boxes) and Android clients. No Apple clients.
I have NOT been specifically unmounting any of the drives before rebooting (typically because of some config change). Didn't think it was necessary. I DO perform a "proper" shutdown/restart from the system menu. It's on a giant UPS with 12+ hours of runtime, and it monitors the UPS via USB and would do a proper shutdown if the battery became low, which has never happened, IE: it has never lost power. Nor any kind of "crash", "panic", or lockup. Other than the music and video drives it's amazingly stable.
I am not aware of any correlation between shutdown/reboots and the lost files and am pretty confident that is not the cause. But if someone here more knowledgeable that me knows otherwise, educate me!
 
Old 03-06-2023, 09:26 PM   #11
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
Originally Posted by DoctorWizard View Post
But how much of that have you seen lately? That was certainly an issue many years ago
You got that right, it's been years. I typically would tell the owner if they keep doing that their computer will continue being unstable. One of the owners don't ask me to fix them anymore, they just purchase cheap laptops and throw em' up against the wall or similar when they get frustrated and I inherit the laptop...then bring it to the recycle depot since it's junk.
 
Old 03-06-2023, 10:10 PM   #12
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Anyway
All I know about RHEL is that it's set up for enterprises and Linux Mint is for kids, (just my way of saying it's focus is to attract new to Linux personal computer users). One is Red Hat based the other Debian. RHEL likely uses strict SELinux policies the other don't implement SELinux.

Trying to transfer settings and configurations would likely be a long frustrating journey with some letdowns. There's a lot of threads here by users trying to do that from one version of a distribution to a newer version of the same distribution where the thread drags on for a week or two and the OP eventually goes quiet for a few days, then comes back and says, "I decided to just do a fresh install and configure from scratch, took all night but got it done".

So..., time might not be an issue for someone retired but what I always see with these threads regarding moving configs to a different installation is a week or two of frustration versus a good day configuring a fresh install. Many come back saying it turned out better than the previous setup since they learned a few things also.
 
  


Reply



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
Reusing /home partition JMJ_coder Linux - General 3 05-14-2008 12:57 PM
Reusing a custom built kernel on a new installation dizzi Slackware 4 08-01-2007 03:57 PM
reusing ubuntu6.10 splash screen madonion87 Ubuntu 2 10-31-2006 09:47 PM
connecting and reusing existing mysql permissions/dbs/tables after update deesto *BSD 0 10-29-2005 03:46 PM
Reusing .config during kernel rebuild ssu4716 Linux - General 1 04-01-2002 12:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint

All times are GMT -5. The time now is 01:57 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