Re: Storage and snapshots as historical yearly
From: Senén Vidal Blanco <hidden>
Date: 2017-09-21 10:07:49
El martes, 19 de septiembre de 2017 21:33:31 (CEST) Andrei Borzenkov escribió:
19.09.2017 14:49, Senén Vidal Blanco пишет:quoted
Perfect!! Just what I was looking for. Sorry for the delay, because before doing so, I preferred to test to see if it actually worked. I have a doubt. The system works perfectly, but at the time of deleting the writing disk and merging the data on the read-only disk I fail to understand the process. I have tried to remove the seed bit on disk A and delete the write B as you mention, and so move the data to A, but tells me that disk B does not exist. These are the orders I have made: md127-> A md126-> B btrfstune -S 0 /dev /md127 mount /dev/md127 /mnt (I mount this disk since the md126 gives error) btrfs device delete /dev/md126 /mnt ERROR: error removing device '/dev/md126': No such file or directory Another thing I've tried is to remove disk B without removing the seed bit, but it gives me the error: ERROR: error removing device '/dev/md126': unable to remove the only writeable device. Any ideas about it?Yes, sorry about it. Clearing seed flag on device invalidates filesystem. What you can do, is to rotate devices. I.e. remove /dev/md126, set seed flag on md127 and add md126 back. I actually tested it and it works for me.
OK thanks Now I see how it works :)) With the commands: mount /dev/md126 /mnt btrfs device remove /dev/md127 /mnt We remove the read-only array (A) from the BTRFS system and in doing so pass all the information from (A) to (B) read-write to mix them. From what I see is not bad since both (A) and (B) are still operational. (A) with last year and (B) with everything current. Finally with this other commands: btrfstune -S 1 /dev/md126 mount /dev/md126 /mnt btrfs device add -f /dev/md127 /mnt we activate the seed bit in md126 (B) and add the (A) in read-write mode, where the new files will be archived and (B) as store until the following year and (A) do clean to fill in it new data. I have tried to rotate twice to see if it goes well and smoothly. Just comment that I see two small problems to this: 1. The transfer of data from (A) to (B) when removing the read-only disk takes quite a while and more the more it has stored in the history. It would be nice if the process were reversed, since in (B) there are fewer "data" stored. Also, I could not use it monthly or daily for this reason. 2. My idea was to have a larger A-disk than B where I would save the historical ones, because so in B I could put a smaller disk and something faster. If the decoupling process outside read-write rather than read-only and passed the data to A would be ideal for this case. On the other hand, as an anecdote only, and perhaps for lack of experience or knowledge, I have used the entire linux system in BTRFS (@ and @home) format and a single partition md126 to have the system bootable and running simply by attaching the disk to the computer in degraded mode (swap outside the raid , which I'm not so bad: P). This has made that by rotating disks A and B I have had some problems with grub and fstab at boot, which I had to overcome by making changes to the boot configurations and some more botches. I'm going to see a couple more things and if there's any way I can combine this with snapshots and see if the bulb will light up. If I do not get it I will try with the other filesystems that you have suggested to me. Although honestly, I like BTRFS more than the other alternatives, I already use BTRFS on 5 computers and it goes very well. Greetings.
quoted
Thank you very much for the reply. Greetings. El martes, 12 de septiembre de 2017 6:34:15 (CEST) Andrei Borzenkov
escribió:
quoted
quoted
11.09.2017 21:17, Senén Vidal Blanco пишет:quoted
I am trying to implement a system that stores the data in a unit (A) with BTRFS format that is untouchable and that future files and folders created or modified are stored in another physical unit (B) with BTRFS format. Each year the new files will be moved to store A and start over. The idea is that a duplicate of disk A can be made to keep it in a safe place and that the files stored there can not be modified until the mixture of (A) and (B) is made.This can probably be achieved using seed device. Mark original device as seed and all changes will go to another writable device, similar to overlay; then remove seed bit from original device, "btrfs device remove writable" device and it should relocate its content back. Rinse and repeat.
-- Senén Vidal Blanco - SGISoft S.L. Tlf.: 986413322 - 660923711 GPG ID 466431A8AF01F99A http://www.sgisoft.com/ --
Attachments
- signature.asc [application/pgp-signature] 195 bytes