Two identical internal hard drives, one for backup?

Hello,

I have two identical hard drives in my PC, one unmounted, one with my 15.5 installation:

> ~> df -h
> Filesystem      Size  Used Avail Use% Mounted on
> devtmpfs        4.0M  8.0K  4.0M   1% /dev
> tmpfs            32G  6.1M   32G   1% /dev/shm
> tmpfs            13G   19M   13G   1% /run
> tmpfs           4.0M     0  4.0M   0% /sys/fs/cgroup
> /dev/sdb3        60G   33G   27G  56% /
> /dev/sdb3        60G   33G   27G  56% /.snapshots
> /dev/sdb3        60G   33G   27G  56% /boot/grub2/i386-pc
> /dev/sdb3        60G   33G   27G  56% /boot/grub2/x86_64-efi
> /dev/sdb3        60G   33G   27G  56% /srv
> /dev/sdb3        60G   33G   27G  56% /opt
> /dev/sdb3        60G   33G   27G  56% /root
> /dev/sdb3        60G   33G   27G  56% /tmp
> /dev/sdb3        60G   33G   27G  56% /usr/local
> /dev/sdb3        60G   33G   27G  56% /var
> /dev/sdb1       511M  9.4M  502M   2% /boot/efi
> /dev/sdb4       869G  227G  642G  27% /home
> tmpfs           6.3G  8.4M  6.3G   1% /run/user/1003
:~> lsblk --paths --output NAME,MAJ:MIN,RM,SIZE,TYPE,MOUNTPOINTS,MODEL,SERIAL
NAME        MAJ:MIN RM   SIZE TYPE MOUNTPOINTS            MODEL                   SERIAL
/dev/sda      8:0    0 931.5G disk                        Samsung SSD 860 EVO 1TB S3Z9NY0M818180W
/dev/sdb      8:16   0 931.5G disk                        Samsung SSD 860 EVO 1TB S3Z9NY0M818187H
├─/dev/sdb1   8:17   0   512M part /boot/efi                                      
├─/dev/sdb2   8:18   0     2G part [SWAP]                                         
├─/dev/sdb3   8:19   0    60G part /var                                           
│                                  /usr/local                                     
│                                  /tmp                                           
│                                  /root                                          
│                                  /opt                                           
│                                  /srv                                           
│                                  /boot/grub2/x86_64-efi                         
│                                  /boot/grub2/i386-pc                            
│                                  /.snapshots                                    
│                                  /                                              
└─/dev/sdb4   8:20   0   869G part /home

Could I use the unmounted HD to periodically backup my /home ? Which tool would do that and How should i mount the HD?

Is such a backup even relevant? Is there a better use to a 2nd internal hard drive?

Thanks

@prodesch:

First – Welcome to the openSUSE Forums!


Does the Mainboard/Motherboard of your PC support RAID?

  • If it does then, simply configure a RAID cluster of 2 drives.

If it doesn’t then, simply configure the spare SSD with a single XFS or ext4 partition – complete disk – and then, mount that partition as “Backup” in “fstab”.

  • Then create a “home-backup” directory owned by the user “root” in that partition, and then create a sub-directory there named “your username” owned by you.

You can then either create your own backup script with “rsync” commands which can be called periodically by means of systemd or, you can use a graphical backup application such as –

  • GNOME → “Déjà Dup”.
  • KDE Plasma → “Back In Time” or “kbackup” or “Kup” (package “kup-backup”) or “luckyBackup”.
  • CLI → “BorgBackup”.
2 Likes

RAID is not backup.

That is complete up to you.

  • Having a “backup” of something on the same disk is of course vulnerable to the disk failing.
  • Having a “backup” of something on a different disk in the same computer is of course vulnerable to e.g. fire damage to the computer.
  • Having a “backup” of something in another computer in the same building is of course vulnerable to the destroying of the house by fire or flood or earthquake.

In short, only you can decide against what disasters you want to protect your data. And then you have to design a backup/restore policy to cover that. And after you implemented it, you have to test if it works as intended.

1 Like

If I correctly recall, the first RAID I saw was in a IBM Mainframe room where there were about 100 disk drives (non-removable – not the things with a stack of 10 platters – and 20 heads – which an operator could remove and replace with a spare one – also a possible backup method … ) – the things about the same size and shape as a washing machine – around about 1981 …

  • There were a couple of 9-track tape drives in the corner – the things with ½ inch tape on reels and vacuum columns to buffer the tape movement (up to 200 inches per second … ) – up to 2 400 feet per reel …
    But, they were only there for copies of critical data which was stored remote from the site.

The big deal then, was to ensure data security on replicated disks without have to employ operators to perform daily backups to tape and, the have data replication “on the fly” – without having to stop the applications executing while the backup was being taken …

Or, having backups, which are usually rotated on a daily basis, located in a secure bank vault physically located at least 50 kilometres from the computer centre … :smiling_imp:

Yes, and the transports to and from off-line storage taking different routes each day. And almost nobody (even operators) knowing where the storage was, only telephone numbers to ask for a certain medium when a restore was needed where available.

RAID is not a backup is repeated for one very good reason, what happens to one ‘copy’ happens to the other. In every situation except hardware failure, there is no other copy to fall back on. It has to be repeated because if you haven’t been educated on how it works, you blindly look at RAID1 and go ‘great, there’s always this copy of my stuff on this other disk’ and it’s not true.

RAID can protect you from hardware failure, if you’re on top of your monitoring.
RAID can improve usable performance of spinning disks.
RAID is not a backup.

It’s also why cloud synced storage is not a backup.

If you want a backup and you go RAID1, you have made a mistake that is waiting to bite you in the ass.

I do not quite understand why you answer this to me specifically. I never mentioned RAID in my posts above and certainly did not give the impression that RAID is a form of back-up.

Infamous host erlangen has two identical NVME SSDs:

erlangen:~ # inxi -Dy222
Drives:    Local Storage: total: 6.37 TiB used: 2.09 TiB (32.8%)
           ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 970 EVO Plus 2TB size: 1.82 TiB
           ID-2: /dev/nvme1n1 vendor: Samsung model: SSD 970 EVO Plus 2TB size: 1.82 TiB
           ID-3: /dev/sda vendor: Crucial model: CT2000BX500SSD1 size: 1.82 TiB
           ID-4: /dev/sdb vendor: Samsung model: HD103UJ size: 931.51 GiB
erlangen:~ # 

They have identical partitioning: EFI System and a single btrfs which occupies 99,9975% of available drive space:

erlangen:~ # fdisk -l /dev/nvme1n1 /dev/nvme0n1
Disk /dev/nvme1n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Samsung SSD 970 EVO Plus 2TB            
Disklabel type: gpt

Device           Start        End    Sectors  Size Type
/dev/nvme1n1p1    2048    1050623    1048576  512M EFI System
/dev/nvme1n1p2 1050624 3907028991 3905978368  1.8T Linux filesystem

Disk /dev/nvme0n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Samsung SSD 970 EVO Plus 2TB            
Disklabel type: gpt

Device           Start        End    Sectors  Size Type
/dev/nvme0n1p1    2048    1050623    1048576  512M EFI System
/dev/nvme0n1p2 1050624 3907029134 3905978511  1.8T Linux filesystem
erlangen:~ # 

Fine grained partitioning still works:

erlangen:~ # fdisk -l /dev/sdb
Disk /dev/sdb: 931.51 GiB, 1000203804160 bytes, 1953523055 sectors
Disk model: SAMSUNG HD103UJ 
Disklabel type: gpt

Device         Start        End    Sectors   Size Type
/dev/sdb1      16065   67119569   67103505    32G Linux filesystem
/dev/sdb2   67119570   71312534    4192965     2G Linux swap
/dev/sdb3   71312535  176168789  104856255    50G Linux filesystem
/dev/sdb5  176168853  218114504   41945652    20G Linux filesystem
/dev/sdb6  218114568 1953520064 1735405497 827.5G Linux filesystem
erlangen:~ # 

Many users stick to this concept of the previous millennium. However it hampers administration and usage of current SSDs and HDDs.

/dev/nvme1n1p2 is the system drive of infamous host erlangen. /dev/nvme0n1p2 is used as the backup drive for the home cloud. All hosts backup their data to this drive using btrbk with its impressive list of key features.

Which still begs the following question –

  • For the case of a fairly modern PC box with 2 identical SSD (non-spinning) drives, what is the better strategy?

  1. For the case of 2 identical SSD SATA drives, a 2 disk RAID will increase the reliability of the system with respect to data reliability affected by SSD array failures over time.
    For the support offered by Btrfs, see here – <2.2 Multi-device file system>.

  2. If the 2 identical drives were mechanical – HDD – then a 2 disk RAID can bring a performance plus and, a hardware reliability plus.

  3. For the case of no RAID – one active drive and, one inactive drive only being used for backup –
    Yes, provided that, the inactive drive is mounted only when the backup is being taken then, there’s a chance that absolute data security will be better than the case with RAID (Virus attacks, etc … ) but, even if the inactive drive is not accessible during normal system activity – it’s not mounted – it’s still powered on and from the point of view of the SSD arrays, still active …
    Therefore, form the point of view of SSD array failures, having 2 identical non-RAID SSDs in a system will not help with the overall data reliability of the system.
    And, the operator will have to execute a daily “mount → backup → unmount” task to secure the system’s data.


My private choice –

  • I’m lazy – born lazy – therefore a simple BIOS/UEFI RAID would be my personal choice for acceptable data reliability given such a system …

Hardware Raid is Dead and is a Bad Idea in 2022

What really matters - From Hardware Considerations

"The following assumptions about storage devices are considered

  1. atomicity of reads and writes of blocks/sectors (the smallest unit of data the device presents to the upper layers)
  2. there’s a flush command that instructs the device to forcibly order writes before and after the command; alternatively there’s a barrier command that facilitates the ordering but may not flush the data
  3. data sent to write to a given device offset will be written without further changes to the data and to the offset
  4. writes can be reordered by the device, unless explicitly serialized by the flush command
  5. reads and writes can be freely reordered and interleaved"

All of the above depends on the specific SSD model. Users may want to verify block checksums (btrfs scrub start) and rewrite of all blocks ( btrfs balance start --full-balance).

The above being said users may refrain from using RAID. Both hardware and software RAID add complexity.

On the other hand managing backups with btrbk is robust, reliable and easy to perform. Source and target mounts on infamous host erlangen are fully automatic:

erlangen:~ # grep /B /etc/fstab 
UUID=0e58bbe5-eff7-4884-bb5d-a0aac3d8a344  /Btrbk                  btrfs  subvolid=5,x-systemd.automount,x-systemd.idle-timeout=10 0  0
UUID=8a723ba5-c46f-45df-b708-0cf9c541da27  /Backup                 btrfs  subvolid=5,x-systemd.automount,x-systemd.idle-timeout=10 0  0
erlangen:~ # 

btrbk is ultra fast and and consumes few resources. Backups are sharing blocks. No deduplication is required.

Typical daily internal backup of system (15GB, 469389 objects) and /home (511GB, 908606 objects) finishes in 12 seconds and consumes 8 seconds CPU time.

erlangen:~ # journalctl --since 0:00 -u btrbk
May 28 01:35:49 erlangen systemd[1]: Starting btrbk backup...
May 28 01:36:01 erlangen btrbk[20085]: --------------------------------------------------------------------------------
May 28 01:36:01 erlangen btrbk[20085]: Backup Summary (btrbk command line client, version 0.32.6)
May 28 01:36:01 erlangen btrbk[20085]:     Date:   Tue May 28 01:35:49 2024
May 28 01:36:01 erlangen btrbk[20085]:     Config: /etc/btrbk/btrbk.conf
May 28 01:36:01 erlangen btrbk[20085]: Legend:
May 28 01:36:01 erlangen btrbk[20085]:     ===  up-to-date subvolume (source snapshot)
May 28 01:36:01 erlangen btrbk[20085]:     +++  created subvolume (source snapshot)
May 28 01:36:01 erlangen btrbk[20085]:     ---  deleted subvolume
May 28 01:36:01 erlangen btrbk[20085]:     ***  received subvolume (non-incremental)
May 28 01:36:01 erlangen btrbk[20085]:     >>>  received subvolume (incremental)
May 28 01:36:01 erlangen btrbk[20085]: --------------------------------------------------------------------------------
May 28 01:36:01 erlangen btrbk[20085]: /
May 28 01:36:01 erlangen btrbk[20085]: +++ /Btrbk/btrbk_snapshots/Backup/ROOT.20240528T0135
May 28 01:36:01 erlangen btrbk[20085]: >>> /Backup/btrbk_snapshots/erlangen/ROOT.20240528T0135
May 28 01:36:01 erlangen btrbk[20085]: /home
May 28 01:36:01 erlangen btrbk[20085]: +++ /Btrbk/btrbk_snapshots/Backup/home.20240528T0135
May 28 01:36:01 erlangen btrbk[20085]: >>> /Backup/btrbk_snapshots/erlangen/home.20240528T0135
May 28 01:36:01 erlangen systemd[1]: btrbk.service: Deactivated successfully.
May 28 01:36:01 erlangen systemd[1]: Finished btrbk backup.
May 28 01:36:01 erlangen systemd[1]: btrbk.service: Consumed 8.051s CPU time.
erlangen:~ # 

External backups are done the same way. They are slower (USB C), but as reliable as the internal backup.

Hmmm –

  • OK – there’s also the issue of SSD Trim which can introduce some unpleasant side effects with respect to RAID …

OK –

  • The original poster should consider setting up an automated backup to the second SSD in the system’s box.

But btrbk only works with btrfs, right? What if “someone” has a XFS filesystem for his home ?

Then, you’ll have to consider what has been mentioned above –

  • CLI / shell script → “rsync”.
  • GNOME → “Déjà Dup”.
  • KDE Plasma → “Back In Time” or “kbackup” or “Kup” (package “kup-backup”) or “luckyBackup”.
  • CLI → “BorgBackup”.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.