Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Finally learned how to use rsync
- ticojohn
- Posts: 1284
- Joined: 2009-08-29 18:10
- Location: Costa Rica
- Has thanked: 21 times
- Been thanked: 44 times
Finally learned how to use rsync
After years of using Grsync to backup just /home, I decided it was time to learn how to use rsync. The main motivation was that I am thinking about upgrading Jessie (i386) to Stretch, and I thought it would be a good time to make a working backup of Jessie. After a bunch of on line searching, and a few missteps, I was finally able to rsync Jessie to an empty partition on my hard drive (Jessie is on a SSD). After changing the entries in fstab, and then updating grub, I now have a working duplicate of Jessie. rsync is COOL!
I am not irrational, I'm just quantum probabilistic.
- sunrat
- Administrator
- Posts: 6497
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 118 times
- Been thanked: 476 times
Re: Finally learned how to use rsync
Yeah it's pretty straightforward once you work out how trailing slashes behave.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: Finally learned how to use rsync
Did you check that the new partition is actually mounted as / ?
In, my experience, updating fstab on the backup system and running update-grub on the original system is not enough and results in the new menu entry mounting the original partition as / ; you need to run update-grub from the backup system (in chroot) before doing it on the original system.
In, my experience, updating fstab on the backup system and running update-grub on the original system is not enough and results in the new menu entry mounting the original partition as / ; you need to run update-grub from the backup system (in chroot) before doing it on the original system.
- ticojohn
- Posts: 1284
- Joined: 2009-08-29 18:10
- Location: Costa Rica
- Has thanked: 21 times
- Been thanked: 44 times
Re: Finally learned how to use rsync
Yep! That caused a few missteps but I finally got there.sunrat wrote:Yeah it's pretty straightforward once you work out how trailing slashes behave.
I am not irrational, I'm just quantum probabilistic.
- ticojohn
- Posts: 1284
- Joined: 2009-08-29 18:10
- Location: Costa Rica
- Has thanked: 21 times
- Been thanked: 44 times
Re: Finally learned how to use rsync
I am still pretty much a noob when it comes to Linux, even though I have been using it for about 7 years, so I'm not sure I understand the question nor how to verify that the partition is mounted as /. I am able to select and load the new partition (sdb1). When I open pcmanfm and look at the file system the top level appears to be /. I will do some further checking but everything is functioning as desired.p.H wrote:Did you check that the new partition is actually mounted as / ?
I am not irrational, I'm just quantum probabilistic.
- ticojohn
- Posts: 1284
- Joined: 2009-08-29 18:10
- Location: Costa Rica
- Has thanked: 21 times
- Been thanked: 44 times
Re: Finally learned how to use rsync
OOOPPPS ! It appears that it is NOT working as expected. When I select the new partition (sdb1) in the grub menu, it is actually booting the original partition (sda1). So what do I need to do?p.H wrote:Did you check that the new partition is actually mounted as / ?
I am not irrational, I'm just quantum probabilistic.
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: Finally learned how to use rsync
As I wrote in my previous message:
- mount and chroot the new partition with /dev/, /sys and /proc
- run update-grub
- exit the chroot and unmount the above
- run update-grub
Or you can edit /boot/grub/grub.cfg on both partitions and replace the UUID of the original partition with the one of the new partition in the root= options of the menu entries for the system on the new partition.
- mount and chroot the new partition with /dev/, /sys and /proc
- run update-grub
- exit the chroot and unmount the above
- run update-grub
Or you can edit /boot/grub/grub.cfg on both partitions and replace the UUID of the original partition with the one of the new partition in the root= options of the menu entries for the system on the new partition.
- ticojohn
- Posts: 1284
- Joined: 2009-08-29 18:10
- Location: Costa Rica
- Has thanked: 21 times
- Been thanked: 44 times
Re: Finally learned how to use rsync
Okay. Not sure editing the /boot/grub/grub.cfg files is a good idea. WOuldn't it get changed when I do update-grub? And my brain is not getting it with your instructions. I will do some research, unless you want to give me detailed instructions. Thanks for the help.p.H wrote:As I wrote in my previous message:
- mount and chroot the new partition with /dev/, /sys and /proc
- run update-grub
- exit the chroot and unmount the above
- run update-grub
Or you can edit /boot/grub/grub.cfg on both partitions and replace the UUID of the original partition with the one of the new partition in the root= options of the menu entries for the system on the new partition.
I am not irrational, I'm just quantum probabilistic.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: Finally learned how to use rsync
The stretch release notes have a nice section about recovery:ticojohn wrote:my brain is not getting it
https://www.debian.org/releases/stretch ... 07.html.en
deadbang
- ticojohn
- Posts: 1284
- Joined: 2009-08-29 18:10
- Location: Costa Rica
- Has thanked: 21 times
- Been thanked: 44 times
Re: Finally learned how to use rsync
Thanks HOAS. What's the worst that can happen?Head_on_a_Stick wrote:The stretch release notes have a nice section about recovery:ticojohn wrote:my brain is not getting it
https://www.debian.org/releases/stretch ... 07.html.en
I am not irrational, I'm just quantum probabilistic.
- ticojohn
- Posts: 1284
- Joined: 2009-08-29 18:10
- Location: Costa Rica
- Has thanked: 21 times
- Been thanked: 44 times
Re: Finally learned how to use rsync
HOAS, if you're there, I do not see a menu option for 'rescue'. I see a recovery mode, but not 'rescue'. Am I being stupid?
I am not irrational, I'm just quantum probabilistic.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: Finally learned how to use rsync
There's an entry on the Debian ISO image GRUB menu, I think.
If not, we've recently added that option to the BunsenLabs Helium-dev ISO image so you could use that:
https://mirror.vinzv.space/bunsenlabs/helium/beta/
If not, we've recently added that option to the BunsenLabs Helium-dev ISO image so you could use that:
https://mirror.vinzv.space/bunsenlabs/helium/beta/
deadbang
- ticojohn
- Posts: 1284
- Joined: 2009-08-29 18:10
- Location: Costa Rica
- Has thanked: 21 times
- Been thanked: 44 times
Re: Finally learned how to use rsync
Okay. I followed the advice from p.H and edited the /boot/grub/grub.cfg on both sda1 and sdb1. After verifying that I could boot as desired I then did update-grub on both sda1 and sdb1. Everything now appears to be working as desired. I know that this probably was NOT the best practice but it got the results I wanted.
Thanks to HOAS and p.H for their help and advice.
Thanks to HOAS and p.H for their help and advice.
I am not irrational, I'm just quantum probabilistic.
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: Finally learned how to use rsync
It was just working as I expected, not as you expected.ticojohn wrote:It appears that it is NOT working as expected.
Sorry for bringing bad news and extra work.
A bit of explaination :
When update-grub/grub-mkconfig detects another Linux installation and builds a menu entry for it, it looks for a grub.cfg file in this installation. If it finds the file, it copies the kernel command line parameters, in the menu entry, including the root= parameter instead of using the actual root location. I guess this is a rather unknow feature of update-grub.
Since the "other" system is a backup copy of the original system, its grub.cfg file contains root= with the UUID of the original root partition. So, even though GRUB loads the kernel and initramfs from the backup partition, they mount the orginal partition as root.
Running update-grub from the backup system would update its grub.cfg with the backup partition UUID. Then running update-grub from the original system would update its grub.cfg with the UUID present in the grub.cfg on the backup partition.
Last edited by p.H on 2018-04-15 12:42, edited 3 times in total.
- ticojohn
- Posts: 1284
- Joined: 2009-08-29 18:10
- Location: Costa Rica
- Has thanked: 21 times
- Been thanked: 44 times
Re: Finally learned how to use rsync
Thanks for that explanation. It makes things a lot more clear to me. Good to know info. Thanks a lot. Eventually I may get around to learning how to use chroot. Probably come in handy.p.H wrote:It was just working as I expected, not as you expected.ticojohn wrote:It appears that it is NOT working as expected.
Sorry for bringing bad news and extra work.
A bit of explaination :
When update-grub/grub-mkconfig detects another Linux installation into the GRUB menu and builds a menu entry for it, it looks for a grub.cfg file in this installation. If it finds the file, it copies the kernel command line parameters, including the root= parameter. I guess this is a rather unknow feature of update-grub.
Since the "other" system is a backup copy of the original system, its grub.cfg file contains root= with the UUID of the original root partition. So, even though GRUB loads the kernel and initramfs from the backup partition, they mount the orginal partition as root.
Running update-grub from the backup system would update its grub.cfg with the backup partition UUID. Then running update-grub from the original system would update its grub.cfg with the UUID present in the grub.cfg on the backup partition.
I am not irrational, I'm just quantum probabilistic.