Welcome! Log In Create A New Profile

Advanced

Back-up SATA rootfs without dismount the disk.

Posted by miazza 
Back-up SATA rootfs without dismount the disk.
April 27, 2022 01:50AM
Hollo everyody.
I have read all the wiky for the back-up but I have not found a wicky for a Backup rootfs using tar command from SATA to USB without dismounting the HD (there is a similar one for cloning but I would prefer a tar file).

Before to make the wrong thing I would like to ask if this will work:

1) boot as normal with last u-boot from SATA rootfs
2) change rootfs LABEL to SATA_rootfs
3) power-off
3) insert a USB drive with preinstalled rootfs
4) switch on and boot from USB rootfs (sata should be disreguarded because of different label)
5) cd to SATA_rootfs disk
6) time tar -cjf /srv/nsa325/my-rootfs.tar.bz2 . &
7) re label SATA_rootfs --> rootfs
8) power-off
9) unplug USB rootfs
10) reboot as normal from SATA rootfs

The idea is to use USB rootfs boot to backup by SATA rootfs on the NAS hd mounted in /srv/nsa325

WIll this work ?

Thanks



Edited 1 time(s). Last edit at 04/27/2022 01:51AM by miazza.
Re: Back-up SATA rootfs without dismount the disk.
April 27, 2022 02:25AM
No, it won't work. Point 5 will fail, as you'll first have to mount it. But it isn't necessary to use another rootfs, you can simply backup the running roofs:
tar -cjf /path/to/backup_of_rootfs.tar.bz2 --one-file-system /
Re: Back-up SATA rootfs without dismount the disk.
April 27, 2022 09:49AM
I've seen you anwer too late, I forgot to tick the e-mail for reply :)

Yes, of course I need to manually mount sata-rootfs before to tar.

I'm doing it right now and it seems to work... tar process running and bz2 file is growing in the destination.

Indeed can I make a live tar as for your post without having any problem during the tar process ?
Re: Back-up SATA rootfs without dismount the disk.
April 27, 2022 03:31PM
Quote

Indeed can I make a live tar as for your post without having any problem during the tar process ?

What Mijzelf show above should work fine. That tar command will exclude everything, only the rootfs is archived (things such as user's /home will be excluded).

You can even use cp to copy the live rootfs, but you'd need to make sure to prepare a few things before running the cp command.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Back-up SATA rootfs without dismount the disk.
April 27, 2022 03:34PM
Thank you to all.
I tried both and they both have worked fine.

miazza
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: