LinuxQuestions.org
Help answer threads with 0 replies.
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 05-11-2024, 11:33 AM   #1
tuxthegreat
Member
 
Registered: Mar 2018
Distribution: Ubuntu Mate, OSX, Win10, ODROID-N2+
Posts: 180

Rep: Reputation: Disabled
Angry Messed up my home permission using deja-dup file restore


Oh boy did I mess things up, I ran deja-dup as root and created a backup of my /home/odroid and then my xserver crashed, I was able to recover however since my laptop's screen is busted, I only have the external monitor via hdmi hooked up. I was able to login blind, I just typed in my password on a empty screen with the ubuntu logo, the login screen was on my laptop but I can't see it cause it's broken. Anyway I was able to open a terminal using mouse right click and then I did sudo deja-dup and I got the deja-dup screen, and I used the backup I created before the xorg crash. Ever since then all my programs run as root, here is a ls -la from my home directory

Quote:
odroid@odroid:~$ ls -la
total 4623428
drwxr-xr-x 37 odroid odroid 4096 Apr 24 17:19 .
drwxr-xr-x 3 root root 4096 Jun 3 2018 ..
-rw-rw-r-- 1 odroid odroid 103 Oct 14 2017 .apport-ignore.xml
-rw------- 1 odroid odroid 77008 Apr 24 17:21 .bash_history
-rw-r--r-- 1 odroid odroid 220 Oct 11 2017 .bash_logout
-rw-r--r-- 1 odroid odroid 3775 Nov 1 2023 .bashrc
drwx------ 2 odroid odroid 4096 Aug 28 2018 BDInfo
drwxr-xr-x 2 root root 4096 Mar 10 2018 bin
drwxr-xr-x 20 odroid odroid 4096 Oct 3 2023 bluez-5.37
-rw-r--r-- 1 odroid odroid 1657760 Dec 28 2015 bluez-5.37.tar.xz
drwx------ 27 odroid odroid 4096 Nov 4 2023 .cache
drwxr-xr-x 2 root root 4096 Feb 7 2018 chkrootkit-0.52
drwxr-xr-x 37 odroid odroid 4096 Mar 15 07:24 .config
drwx------ 3 odroid odroid 4096 Oct 11 2017 .dbus
drwxr-xr-x 2 odroid odroid 4096 May 11 14:19 Desktop
-rw-r--r-- 1 odroid odroid 38 Jul 20 2021 .dmrc
drwxr-xr-x 2 odroid odroid 4096 Jul 20 2021 Documents
drwxr-xr-x 9 odroid odroid 4096 May 11 14:18 Downloads
-rw-r--r-- 1 root root 0 Oct 12 2023 find
-rw-r--r-- 1 root root 0 Dec 18 2018 firewall-6.txt
drwxrwxr-x 6 odroid odroid 4096 Dec 18 2018 Firewall Chains
-rw-r----- 1 root root 2236 Dec 8 15:54 firewall.txt
drwxr-xr-x 2 odroid odroid 4096 Dec 20 2017 .fishBMC-data
drwx------ 3 odroid odroid 4096 Oct 18 2023 .gconf
-rw-r----- 1 odroid odroid 0 Sep 26 2023 .gksu.lock
drwx------ 3 odroid odroid 4096 Oct 17 2017 .gnome
drwx------ 4 odroid odroid 4096 Oct 17 2023 .gnome2
drwx------ 2 odroid odroid 4096 Oct 17 2023 .gnome2_private
drwx------ 3 odroid odroid 4096 Apr 24 17:19 .gnupg
-rw-r--r-- 1 root root 0 Oct 22 2018 grep
drwx------ 2 root root 4096 May 7 2018 .gvfs
drwxr--r-- 2 odroid odroid 4096 Apr 13 2020 .hardinfo
drwxr-xr-x 2 root root 4096 Oct 15 2017 .ibam
-rw------- 1 odroid odroid 178892 Apr 24 17:19 .ICEauthority
drwxrwxr-x 2 odroid odroid 4096 Mar 10 2020 .icons
-rw-r--r-- 1 root root 1708 Dec 13 2022 key.pem
drwxr-xr-x 8 odroid odroid 4096 Oct 12 2017 .kodi
-rw-rw---- 1 odroid odroid 4725582549 May 11 01:10 kodi-backup.tar.gz
-rw-rw---- 1 odroid odroid 1074816 Jan 15 12:02 kodi_crashlog-20240115_120242.log
-rw-rw---- 1 odroid odroid 1171731 Feb 24 08:32 kodi_crashlog-20240224_083221.log
-rw-r--r-- 1 root root 0 Jul 20 2021 .lesshsQ
-rw------- 1 root root 28 Nov 6 2018 .lesshst
drwx------ 5 odroid odroid 4096 Sep 22 2020 .local
-rw-r----- 1 odroid odroid 149 Jul 30 2021 lynis.log
-rw-r----- 1 odroid odroid 14087 Jul 19 2021 lynis-report.dat
-rw-r----- 1 root root 8 Oct 30 2023 mate-control-center
-rwx------ 1 odroid odroid 285350 Dec 9 21:08 metadata.universal-5.5.14.zip
drwxrwxr-x 3 odroid odroid 4096 Aug 29 2018 .mono
drwx------ 5 odroid odroid 4096 Mar 13 2018 .mozilla
drwxr-xr-x 2 odroid odroid 4096 May 10 23:05 Music
drwxr-xr-x 2 odroid odroid 4096 Oct 22 2017 .nano
-rw------- 1 odroid odroid 2251 Nov 11 2023 nohup.out
-rw-r--r-- 1 odroid odroid 230 Oct 12 2017 .pam_environment
drwxr-xr-x 2 odroid odroid 4096 Aug 18 2021 Pictures
drwx------ 3 odroid odroid 4096 Oct 17 2017 .pki
-rw-r--r-- 1 odroid odroid 655 Oct 11 2017 .profile
drwxr-xr-x 2 odroid odroid 4096 Oct 11 2017 Public
drwxr-x--- 5 odroid odroid 4096 Oct 30 2023 .python-eggs
-rw-rw-r-- 1 odroid odroid 52 Mar 2 2018 quiet.conf
-rw-rw-r-- 1 odroid odroid 358943 Dec 4 2017 repository.5star-1.0.2.zip
-rwx------ 1 odroid odroid 357826 Dec 13 2017 repository.5star-1.0.6.zip
-rw-r--r-- 1 root root 32739 Oct 17 2023 repository.linuxaddons-1.0.1.zip
-rw------- 1 root root 1024 Dec 13 2022 .rnd
-rw-r--r-- 1 odroid odroid 66 Oct 22 2017 .selected_editor
-rwxr-xr-x 1 root root 2918 Oct 28 2017 sessionclean
-rwxr-xr-x 1 odroid odroid 299339 Jan 11 2018 spectre-meltdown-checker.sh
drwx------ 2 odroid odroid 4096 Nov 6 2023 .ssh
-rw-r--r-- 1 odroid odroid 391324 Oct 30 2017 subtitles.zip
-rw-r--r-- 1 odroid odroid 0 Oct 11 2017 .sudo_as_admin_successful
drwxr-xr-x 2 odroid odroid 4096 Oct 11 2017 Templates
-rw-r--r-- 1 root root 877 Apr 1 2018 test_results
drwxrwxr-x 2 odroid odroid 4096 Mar 10 2020 .themes
-rwx------ 1 odroid odroid 15026 Oct 29 2023 TotalTraffic-0.1-py2.6.egg
-rwxrw-r-- 1 odroid odroid 89 Mar 10 2018 update-mydebs
drwxr-xr-x 2 odroid odroid 4096 Oct 11 2017 Videos
-rw-r--r-- 1 root root 265 Dec 2 18:31 .wget-hsts
-rw-r--r-- 1 odroid odroid 177267 Dec 13 2022 wget-log
-rw------- 1 odroid odroid 51 Apr 24 17:19 .Xauthority
-rw-rw-r-- 1 odroid odroid 131 Oct 11 2017 .xinputrc
-rw-r--r-- 1 root root 35 Oct 17 2023 .xprofile
-rw-r----- 1 root root 66 Oct 30 2023 .xsession
-rw------- 1 odroid odroid 2419033 May 11 18:10 .xsession-errors
-rw------- 1 odroid odroid 7925 Apr 24 17:19 .xsession-errors.old
Here is my ls -la from /home/odroid/.config

Quote:
odroid@odroid:~/.config$ ls -la
total 176
drwxr-xr-x 37 odroid odroid 4096 Mar 15 07:24 .
drwxr-xr-x 37 odroid odroid 4096 Apr 24 17:19 ..
drwxr-xr-x 2 odroid odroid 4096 May 7 2018 autostart
drwx------ 14 odroid odroid 4096 Jan 2 2019 brave
drwx------ 3 odroid odroid 4096 Jan 14 2019 BraveSoftware
drwxr-xr-x 3 odroid odroid 4096 Apr 24 21:41 caja
drwxrwxr-x 2 odroid odroid 4096 Nov 14 2017 Clementine
drwxrwxr-x 2 odroid odroid 4096 May 11 18:25 dconf
drwx------ 7 odroid odroid 4096 May 11 18:26 deluge
drwx------ 2 odroid odroid 4096 Oct 29 2017 enchant
drwx------ 3 odroid odroid 4096 Oct 30 2023 evolution
drwxrwxr-x 3 odroid odroid 4096 Oct 11 2017 folder-color
drwxr-xr-x 2 odroid odroid 4096 Mar 10 2018 gedit
drwxr-x--- 2 odroid odroid 4096 Oct 30 2023 goa-1.0
drwx------ 2 odroid odroid 4096 May 11 17:05 gtk-2.0
drwx------ 2 odroid odroid 4096 Oct 11 2017 gtk-3.0
drwx------ 6 odroid odroid 4096 Apr 27 23:53 hexchat
drwxr--r-- 2 odroid odroid 4096 Oct 12 2017 htop
drwx------ 3 root root 4096 Oct 30 2023 ibus
drwxr-xr-x 2 odroid odroid 4096 Jun 27 2018 libaccounts-glib
drwxrwxr-x 3 odroid odroid 4096 Oct 11 2017 libreoffice
drwx------ 4 odroid odroid 4096 Mar 10 2020 mate
drwxrwxr-x 3 odroid odroid 4096 Oct 16 2017 mate-menu
drwxr-xr-x 3 odroid odroid 4096 Oct 12 2017 mate-session
drwx------ 3 odroid odroid 4096 Oct 17 2017 menus
-rw-rw---- 1 odroid odroid 3555 Jan 7 22:48 mimeapps.list
-rw-rw---- 1 odroid odroid 1739 Oct 17 2023 monitors.xml
-rw-rw-r-- 1 odroid odroid 89 Oct 13 2017 pavucontrol.ini
drwxrwxr-x 3 odroid odroid 4096 Oct 11 2017 plank
drwxr-xr-x 2 odroid odroid 4096 Nov 5 2023 pluma
drwx------ 2 odroid odroid 4096 Oct 18 2023 pulse
drwxrwx--- 2 odroid odroid 4096 Oct 25 2023 qBittorrent
-rw-rw---- 1 odroid odroid 113 Oct 8 2023 QtProject.conf
drwxrwxr-x 2 odroid odroid 4096 Oct 11 2017 synapse
drwxrwxr-x 2 odroid odroid 4096 Nov 11 2023 tilda
drwx------ 5 odroid odroid 4096 May 11 18:23 transmission
drwx------ 2 odroid odroid 4096 Dec 24 22:29 transmission-remote-gtk
-rw-r--r-- 1 odroid odroid 4077 Nov 14 2017 Trolltech.conf
drwxrwxr-x 3 odroid odroid 4096 Oct 11 2017 ubuntu-mate
drwx------ 2 odroid odroid 4096 Oct 11 2017 update-notifier
-rw------- 1 odroid odroid 632 Oct 11 2017 user-dirs.dirs
-rw-rw-r-- 1 odroid odroid 5 Oct 11 2017 user-dirs.locale
drwxrwxr-x 2 odroid odroid 4096 May 31 2019 vlc
drwxrwxr-x 2 odroid odroid 4096 Nov 15 2017 yelp
As you can see transmission is run as root and all my external hard drives mount themselves as root

Quote:
odroid@odroid:/media/odroid$ ls -la
total 4616
drwxr-x---+ 21 root root 4096 May 11 18:10 .
drwxr-xr-x 3 root root 4096 Jan 30 2023 ..
drwx------ 1 odroid odroid 131072 May 11 14:05 Backup
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies1
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies10
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies11
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies12
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies13
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies14
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies15
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies2
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies3
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies4
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies5
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies6
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies7
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies8
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies9
drwx------ 1 odroid odroid 262144 Jan 1 1970 Movies and
drwx------ 1 odroid odroid 131072 May 11 18:12 Mushkin
drwx------ 1 odroid odroid 262144 Jan 1 1970 SamsungTV
I tried editing /etc/fstab but none of the external drives are listed in there

Quote:
odroid@odroid:~$ sudo cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda2 during installation
UUID=c5465792-5db5-4e8f-9a55-f88e549ff30c / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=D836-8E85 /boot/efi vfat umask=0077 0 1
# swap was on /dev/sda3 during installation
UUID=fbaccbc0-144d-4e3a-a2a7-ba18f59cca5e none swap sw 0 0
I am at a loss. I have a spare laptop, the same exact model, I was thinking of swapping out the nvme from the broken one into the other one so I could see the login screen so I could create a new user but that's a last resort, can you guys help me?
 
Old 05-11-2024, 11:38 AM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,154

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
try:
Code:
cd ~
sudo chown -R $USER:$USER .
That should reset the ownerships in your home folder.
 
Old 05-13-2024, 12:46 PM   #3
tuxthegreat
Member
 
Registered: Mar 2018
Distribution: Ubuntu Mate, OSX, Win10, ODROID-N2+
Posts: 180

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Keith Hedger View Post
try:
Code:
cd ~
sudo chown -R $USER:$USER .
That should reset the ownerships in your home folder.
That solves half the problem, I have programs in my home folder which transfer data to my external drives which are mounted as root so once I run the command I will be in trouble any ideas as how to get my externals to mount with write permissions as normal user, as they aren't even mounted in fstab.
 
Old 05-13-2024, 01:44 PM   #4
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,150

Rep: Reputation: 393Reputation: 393Reputation: 393Reputation: 393
Assuming they are linux partitions you mount then chown the mountpoint as well. Just be careful to target the mountpoint and not the whole installation.
 
Old 05-13-2024, 04:50 PM   #5
tuxthegreat
Member
 
Registered: Mar 2018
Distribution: Ubuntu Mate, OSX, Win10, ODROID-N2+
Posts: 180

Original Poster
Rep: Reputation: Disabled
Angry

Quote:
Originally Posted by jmgibson1981 View Post
Assuming they are linux partitions you mount then chown the mountpoint as well. Just be careful to target the mountpoint and not the whole installation.
The external hard drives are Exfat and every time I reboot their /dev/sd# changes, so that's a problem, is there a one solution to mount them as read and write, this problem only started when I used deja-dup as root to restore my /home partition and a few others, I don't remember which but I remember one was /var Am I really screwed here guys, I can always backup my most needed programs in .config directories and after a reinstall just move them into place once I installed the programs. But that is the nuclear option. As it stands now , my installation runs, but as root, I don't use it to browse, only to watch movies and TV shows. I use iptables instead of that frontend program that comes installed with Ubuntu, I prefer cli control over my iptables. I block http and https and ssh ports and a few others, I am connected to a Linksys 3200acm WRT with dd-wrt installed on it via eth0 not wifi. Boy did I screw this up
 
Old 05-13-2024, 06:06 PM   #6
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,150

Rep: Reputation: 393Reputation: 393Reputation: 393Reputation: 393
Mounting drives via /dev/sd* is not a good idea for exactly this reason. You need to use UUID's for regular partitions to be guaranteed a consistent mount every single time.

Code:
UUID=10274980257509175809518 /backup/drive/mount ext4 defaults,noauto 0 0
This should be in your fstab for each drive. You need to supply the proper UUID of course. Then every time you mount the drive it will always mount in the same place.

you can also change
Code:
defaults,noauto
to
Code:
defaults,noauto,x-systemd.automount,x-systemd.idle-timeout=30
It will self mount when a process accesses the mountpoint and then umount itself after 30s of no activity. Once you have a consistent mountpoint it should work.

Now that being said it really depends on how you used DejaDup. While some report it working great for system files that is not it's intended purpose. You should be using something like timeshift for system backups. Dejadup is very much a user tool. Can be used for system but far more complicated to get than for user files. Since you aren't clear on basic mounting (and I'm not being mean or rude I hope, just honest) then it's very likely you may have blasted or lost a fair number of permissions in your /var directory if that is one you did. To say nothing of the others. I firmly believe this is a good time for you to backup any user data and reinstall to have a clean slate fresh slate to start from. Then create a timeshift backup. Then do whatever you are trying to do. Worst case you can reload the timeshift snapshot if necessary. Then look into the above fstab lines for your backup externals. And don't use /dev/sd* if you can help it, there really is little to no reason to do it these days.

Last edited by jmgibson1981; 05-13-2024 at 06:11 PM.
 
1 members found this post helpful.
Old 05-14-2024, 12:20 PM   #7
tuxthegreat
Member
 
Registered: Mar 2018
Distribution: Ubuntu Mate, OSX, Win10, ODROID-N2+
Posts: 180

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by jmgibson1981 View Post
Mounting drives via /dev/sd* is not a good idea for exactly this reason. You need to use UUID's for regular partitions to be guaranteed a consistent mount every single time.

Code:
UUID=10274980257509175809518 /backup/drive/mount ext4 defaults,noauto 0 0
This should be in your fstab for each drive. You need to supply the proper UUID of course. Then every time you mount the drive it will always mount in the same place.

you can also change
Code:
defaults,noauto
to
Code:
defaults,noauto,x-systemd.automount,x-systemd.idle-timeout=30
It will self mount when a process accesses the mountpoint and then umount itself after 30s of no activity. Once you have a consistent mountpoint it should work.

Now that being said it really depends on how you used DejaDup. While some report it working great for system files that is not it's intended purpose. You should be using something like timeshift for system backups. Dejadup is very much a user tool. Can be used for system but far more complicated to get than for user files. Since you aren't clear on basic mounting (and I'm not being mean or rude I hope, just honest) then it's very likely you may have blasted or lost a fair number of permissions in your /var directory if that is one you did. To say nothing of the others. I firmly believe this is a good time for you to backup any user data and reinstall to have a clean slate fresh slate to start from. Then create a timeshift backup. Then do whatever you are trying to do. Worst case you can reload the timeshift snapshot if necessary. Then look into the above fstab lines for your backup externals. And don't use /dev/sd* if you can help it, there really is little to no reason to do it these days.
Ok I get what you are saying, one minor detail, the externals aren't ext4, they are exfat, what do I put in fstab for a exfat drive ?

You showed me this
Code:
UUID=10274980257509175809518 /backup/drive/mount ext4 defaults,noauto 0 0
How would you change it to suit a exfat drive? Thank you for your patience and time.

I came up with this, is this correct ?

Code:
UUID=10274980257509175809518   /media/odroid/Movies1  exfat   defaults,noauto,nofail  0   0

Last edited by tuxthegreat; 05-15-2024 at 02:34 AM.
 
  


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
[SOLVED] I ran deja-dup in a cron as root and now my system is messed up, everything runs as root, please help guys this is imprortant tuxthegreat Linux - Newbie 7 10-30-2023 04:30 PM
LXer: How to Backup and Restore Files using Deja Dup in Linux LXer Syndicated Linux News 0 07-22-2021 04:17 AM
LXer: How To Backup And Restore Files Using Deja Dup In Linux LXer Syndicated Linux News 0 07-03-2021 11:39 PM

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

All times are GMT -5. The time now is 03:36 AM.

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