You are not logged in.

#1 2023-06-11 02:06:19

Automath
Member
Registered: 2016-05-16
Posts: 115

Backup is resulting an odissey

I know it's easy as pie, also easy as pie is to mess things, so I'm trying to take measures in order to avoid scrambling it, specially when using rsync --delete.

So, to be extra safe, the better practice would be to mount source as read only, the problem is how do I mount  my home partition as read only while the system is running. And no,I'm not going to boot the live cd only to set my home as read only.

Luckly I taken the precaution of havin all my .conf and .cache crap somewhere else, now the thing is how can I mount my home partition as read only while the system is in use?

I tried mount -o ro /dev/sdb4 /disks/somewhere_else
but:
mount: /disks/home: /dev/sdb4 already mounted on /home/human.

What a novelty! I was trying to mount my home twice and read only the second time.

The other solution is to run rsync as a user without write permission on sources, but I'm not sure how to do it.

Edit: I created the user rsync, the trouble is that if I run it as -AaX I will have the same trouble in destination next time. Any way of granting access to specific user by mount neverless  what permissions are set?

Solved: mount -bind /home/user /somewhere_else
mount -o bind,ro,remount /somewhere_else

Last edited by Automath (2023-06-11 03:04:28)

Offline

#2 2023-06-11 02:20:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,471
Website

Re: Backup is resulting an odissey

You'd need to log out of any (non-root) user session to unmount /home (in order to remount 'ro').


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2023-06-11 02:36:21

Automath
Member
Registered: 2016-05-16
Posts: 115

Re: Backup is resulting an odissey

Trilby wrote:

You'd need to log out of any (non-root) user session to unmount /home (in order to remount 'ro').

I'm almost sure, that if i try that as root in the tty I will have device in use error. Let me check. Anyway still not ellegant.

Edit: yep, destiny is busy...

Last edited by Automath (2023-06-11 02:40:53)

Offline

#4 2023-06-11 03:18:23

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,471
Website

Re: Backup is resulting an odissey

Post the exact error.  If you've actually logged out of your user session, it should not be in use.

Automath wrote:

Anyway still not ellegant.

I never suggested it would be - but it's the question you asked.  Unmounting your home partition just to do a backup seems silly to me.

Last edited by Trilby (2023-06-11 03:19:40)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2023-06-11 20:17:19

Automath
Member
Registered: 2016-05-16
Posts: 115

Re: Backup is resulting an odissey

Trilby wrote:

Post the exact error.  If you've actually logged out of your user session, it should not be in use.

Automath wrote:

Anyway still not ellegant.

I never suggested it would be - but it's the question you asked.  Unmounting your home partition just to do a backup seems silly to me.

So binding asread only is ok? I already done it anyway.

Offline

#6 2023-06-12 15:08:53

Section8
Member
Registered: 2023-05-12
Posts: 23

Re: Backup is resulting an odissey

As an alternative, you could use a snapshot.  My home partition is an LVM logical volume - my daily backup job takes a snapshot of it and makes an incremental backup from the snapshot.

Offline

Board footer

Powered by FluxBB