[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#814088: Be cautious about data-loss !!



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


This obviously has been a low-priority project, but I have the box basically up and
running now.

If you have a similar scenario as myself, with an external harddisk with data on it, that
you want to integrate into a RAID and use as network-storage, don't do it the way, I did
it, transferring the data over NFS and then trying to set up the RAID straight away.

I lost half of my data that way, because balancing the data over the two disks failed due
to read-errors, there were 300+ of them on the new internal SATA-disk, that had only 24
hours of operation-time yet. The extended long SMART selftest's result was that, the
disk-health is basically good, so actually the failure may be due to bad karma mainly and
carelessness.
So I zeroed out the whole drive with dd and tried again, now it seems to work well enough.
I set it up the same way and checked, the problem was not due to misaligned partitions,
which was not the case, although it's an advanced format disk with 4k blocks, cfdisk did
the partitioning job quite well, that was checked on afterwards with parted.

If you have data you cannot afford to lose, connect the external USB-disk directly to the
NAS-box and transfer the data manually on the terminal using SSH, not with the graphical
file-manager of your choice, say '$ cp -av .. ..' for instance.
Then balance the data on the internal drive in order to check for errors:
#  btrfs balance start -v /mnt/sata

If that goes well, you are most probably fine to add the external disk to the RAID and
re-balance it as RAID1:
#  btrfs device add -f /dev/sdd1 /mnt/sata/
#  btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt/sata/

When spreading out the existing data over the two devices is finished, you can start
populating the disk with other data over NFS, I did a reboot first.

One problem, which actually appeared chronologically first is the question about
permissions. I introduced a special group for network-storage on the NAS and wanted to
add users on the network, who are allowed to write on it to that same group with the same
GID, but that doesn't work over NFS. If you need something like it, you may have to deal
with NFS-ACLs and the package fs4-acl-tools on the clients:

> Package: nfs4-acl-tools                  
> State: not installed
> Version: 0.3.3-2.1
> Priority: extra
> Section: admin
> Maintainer: Anibal Monsalve Salazar <anibal@debian.org>
> Architecture: amd64
> Uncompressed Size: 104 k
> Depends: libattr1 (>= 1:2.4.46-8), libc6 (>= 2.14)
> Description: Commandline and GUI ACL utilities for the NFSv4 client
>  This package contains commandline and GUI ACL utilities for the Linux NFSv4 client.
> Homepage: http://www.citi.umich.edu/projects/nfsv4/linux/

But since I essentially have a single-user network and since NFS-ACLs are beyond LPIC-2
level, I simply used my primary UID and GID on the NAS and mapped root-access to the
network-storage group only, which works just fine.





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlblhVUACgkQ5+rBHyUt5wu5igCdHhj5VhUeMbw3XrkbWKKugzH5
fuwAn1Bbicvn32S2j3vR/O1K/H2p2/AJ
=D2I4
-----END PGP SIGNATURE-----

Reply to: