Solved - backup using rsync
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Solved - backup using rsync
I screwed up!!!
I originally wanted to create an exact copy of my desktop Home folder on my external drive SDC ( which is a 2TB drive) as a backup and then setup my desktop Home folder on SDB so I don't run out of space. As an alternative how would I setup specific folders like woodworking, Linux, Ham radio etc on SDB but have them show up as sub-folders under a primary folder which is under 'Home' on the desktop of SDA.
My setup (mint 20.2) is on SDA which is 1TB drive. I was sitting around 500GB free. What I was trying to do was enable SDB which is an internal HD of 1TB as my Home folder storage. I did a google on how to do it and I found a page (https://www.howtogeek.com/427480/how-to ... ux-system/) on how to back up my Home directory as a backup on what I thought was an external 2TB drive (SDC) which if have named 'Storage A' using 'sudo rsync -r /home/ve3sjv /media/ve3sjv/Storage_A'. What that did was create a directory in SDA under /media/home/ve3sjv/Storage_A. And my usable free space on SDA is now 130GB. I've tried going into /media/Storage_A as root and rm -rf ve3sjv, I've tried going into individual directories like PDFs or Videos and tried deleting the directories and files. The result is permission denied.
That's where things stand at the moment. I need to regain the 350GB I lost.
I originally wanted to create an exact copy of my desktop Home folder on my external drive SDC ( which is a 2TB drive) as a backup and then setup my desktop Home folder on SDB so I don't run out of space. As an alternative how would I setup specific folders like woodworking, Linux, Ham radio etc on SDB but have them show up as sub-folders under a primary folder which is under 'Home' on the desktop of SDA.
My setup (mint 20.2) is on SDA which is 1TB drive. I was sitting around 500GB free. What I was trying to do was enable SDB which is an internal HD of 1TB as my Home folder storage. I did a google on how to do it and I found a page (https://www.howtogeek.com/427480/how-to ... ux-system/) on how to back up my Home directory as a backup on what I thought was an external 2TB drive (SDC) which if have named 'Storage A' using 'sudo rsync -r /home/ve3sjv /media/ve3sjv/Storage_A'. What that did was create a directory in SDA under /media/home/ve3sjv/Storage_A. And my usable free space on SDA is now 130GB. I've tried going into /media/Storage_A as root and rm -rf ve3sjv, I've tried going into individual directories like PDFs or Videos and tried deleting the directories and files. The result is permission denied.
That's where things stand at the moment. I need to regain the 350GB I lost.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: backup using rsync
There's an unfortunate set of alternatives in your report. I.e., you say that you did
but then say that wound up in
would get rid of it again. Of course make sure that indeed all that's there can and should go before doing so.
Other that that it seems the main issue was that you hadn't in fact mounted the drive before doing the copying (and that you used sudo; normally that should not be needed when having the automounter mount stuff under /media/<you>).
Code: Select all
sudo rsync -r /home/ve3sjv /media/ve3sjv/Storage_A
/media/home/ve3sjv/Storage_A
, i.e., with the additional home
. Then one sentence later you say to have tried to delete /media/Storage_A/ve3sjv
, i.e., leaving out the first occurrence of "ve3sjv" as a path component: assuming that your rsync command was quoted correctly, where things ended up was /media/ve3sjv/Storage_A/ve3sjv and a simpleCode: Select all
sudo rm -r /media/ve3sjv/Storage_A/ve3sjv
Other that that it seems the main issue was that you hadn't in fact mounted the drive before doing the copying (and that you used sudo; normally that should not be needed when having the automounter mount stuff under /media/<you>).
Re: backup using rsync
Actually Storage A was mounted but as USER I didn't have permission to write to it hence the sudo. Also I did not realize that "Storage A" is different than "Storage_A". I thought I would need something to "tie" "Storage" and "A" together because when I did the line with "Storage A" it told me Storage was not found. Did some reading and have since found the exclamation ties a two word named folder as a single name (as I understand it). I'll keep trying to remove the /media/ve3sjv/Storage_A and I will succeed at some point.
Re: backup using rsync
That is a very unclear story. However, as long as your original files you attempted to move, you have not screwed up, yet.
You used "sudo" to copy your data elsewhere using "rsync". You used the option `-r`, which means "recursive", nothing more (that were the wrong options to create an identical copy of your home folder). Accordingly, the copied files or folders are owned by user "root", i.e., system administrator. And therefore, you cannot delete these copied data as normal user. You again need "root" permissions to delete these data.
Be very careful in removing the copied data again. Because you must do that as root, you will be playing with fire. As a general rule, use "sudo" only when you know very well what you are doing.
You used "sudo" to copy your data elsewhere using "rsync". You used the option `-r`, which means "recursive", nothing more (that were the wrong options to create an identical copy of your home folder). Accordingly, the copied files or folders are owned by user "root", i.e., system administrator. And therefore, you cannot delete these copied data as normal user. You again need "root" permissions to delete these data.
Be very careful in removing the copied data again. Because you must do that as root, you will be playing with fire. As a general rule, use "sudo" only when you know very well what you are doing.
Re: backup using rsync
Agreed, I couldn't work out whether the OP had mounted the partition on the external drive or not.
Back when I used home grown scripts with rsync to backup my home folder I used:
Code: Select all
rsync -aAXhz --stats --delete --no-inc-recursive --info=progress2 --log-file=$logfile --exclude={".*",".*/","VirtualBox VMs/"} "$source1" "$destination"
Haven't used this since 2017 when I discovered that timeshift and backintime were easier.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: backup using rsync
Hi Rene
I used the suggested command <sudo rm -r /media/ve3sjv/Storage_A/ve3sjv> as suggested and all files(folders) are gone and I have my 300+GB free space again. My original intent was to create an exact copy of all files/folders in my Home directory on an external 2TB hard drive. I didn't think it would create the "Storage_A" as a sub-folder under /media. Lesson learned. I think I'll just stick to regular backups from now on. Again thanks for your help.
I used the suggested command <sudo rm -r /media/ve3sjv/Storage_A/ve3sjv> as suggested and all files(folders) are gone and I have my 300+GB free space again. My original intent was to create an exact copy of all files/folders in my Home directory on an external 2TB hard drive. I didn't think it would create the "Storage_A" as a sub-folder under /media. Lesson learned. I think I'll just stick to regular backups from now on. Again thanks for your help.
Re: backup using rsync
Hi vanadium and AndyMH.
My original intent was to create an exact copy of my Home directory on an external 2TB hard drive. I did a google and found a page that seemed to be what I needed. What I didn't realize was that even though SDC (the 2TB HD) was formatted as ext4 and mounted I as user had no access to write to the drive and also I wasn't aware it would create a new virtual device under /media which filled my hard drive. I think I will stick to just a plain backup from now on. Lesson learned. Thanks for the assistance. Never had a course on Linux and just basically learning as I continue to use the OS. Rene provided me with a code that removed all files under the "Storage_A" virtual drive I created under /media. Your help was definitely appreciated.
My original intent was to create an exact copy of my Home directory on an external 2TB hard drive. I did a google and found a page that seemed to be what I needed. What I didn't realize was that even though SDC (the 2TB HD) was formatted as ext4 and mounted I as user had no access to write to the drive and also I wasn't aware it would create a new virtual device under /media which filled my hard drive. I think I will stick to just a plain backup from now on. Lesson learned. Thanks for the assistance. Never had a course on Linux and just basically learning as I continue to use the OS. Rene provided me with a code that removed all files under the "Storage_A" virtual drive I created under /media. Your help was definitely appreciated.
Re: Solved - backup using rsync
That is generally a bad thing. You should correct that. Perhaps you formatted it with gparted? If so, that makes root the owner. I recommend you format it EXT4 with the Disks software if you can accept losing all the data on the drive. Another option is to just force all of it to you being the owner. Perhaps something like this:What I didn't realize was that even though SDC (the 2TB HD) was formatted as ext4 and mounted I as user had no access to write to the drive
Code: Select all
sudo chown -R $USER:$USER /media/john/[your_drive_name]
Re: Solved - backup using rsync
It should be persistent.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Solved - backup using rsync
Hi Mikeflan. Yes, I formatted it with gparted. I move all pertinent files to a 4TB drive so anything that was left was fair game to delete.
Re: Solved - backup using rsync
OK, so try the sudo chown command above and maybe that is all you need to do. Then after you own all the files and directories you don't need to use sudo again to manipulate the files.