Eugene Andrienko <[email protected]> writes: > The existing system description: > > 1) I have a disk #1 with a big partition (rraid0b) used as a physical > volume for a volume group (vg0), for LVM. > 2) On top of vg0 there is a logical volume lv0, which takes all > available space on the rraid0b. > 3) On top of the lv0 there will be encrypted CGD device. The resulting > cgd0a will be formatted in FFSv2. > > What I'm trying to achieve: > > 4) Buy a big disk #2 and add it to the volume group vg0 with the help of > lvm vgextend command. Then enlarge the logical volume lv0 to the size > at near rraid0b_size + big_disk_no2_size (with the help of lvm > lvextend command). > 5) ??? do something with cgd ??? > 6) Enlarge FFSv2 with the help of resize_ffs command. > 7) Don't lost my files during the process.
I understand that you want encrypted filesystem on your netbsd-as-NAS box, so that if you shut it down the data is unreadable. I haven't done this, but my reaction is that you are walking into not-well-traveled territory and there is considerable risk. My advice is to step back and consider: reevaluate your backup strategy. do you have multiple, good, offline backups of all this data? Have you tested them? If not, fix that first. Think about whether you want/need RAID of some sort. A fileserver with multiple disks that are basically RAID-0 (concatenated) means that if either breaks, you lose your filesystem. In the old days I used RAID-1 with raidframe, which has saved me twice personally and I don't remember how many times at work (we had maybe 4 such systems and spare disks on hand, turning disk failures from a really bad situation into "this morning the sysadmin will replace the failed disk instead of whatever else they were doing to do", which is awesome in comparison). Think about zfs. ZFS on NetBSD really only works on NetBSD 11 and current, unless maybe you have vastly more memory than you need, or you never use a program that does write via mmap. I am unclear on zfs encryption. I am unclear on if creating a huge zvol and using cgd works. Still the raid considerations apply. My other advice is that you could perhaps borrow a disk and dump the fs to cgd on it, and then set up the two-disk logical volume and restore. A dump/newfs/restore is not a bad thing every 10 years anyway, recovering from undetected bugs in fs code and disk problems. But I find RAID-0 too scary, if you can possibly avoid it. I realize disk prices are crazy.
