On 10/11/21 04:18, Josef Strýček wrote:

Hi,

I have a question how to partition new debain installation.I have 64GB ssd
and 500GB hdd. Can I have / on ssd with ext4 and hdd with btrfs /hame /var

/tmp /opt.


You should be able to achieve that layout with the Debian installer (d-i) by choosing "Partitioning method" -> "manual".


I ran btrfs for a few years, but did not understand the maintenance requirements. Over time, the disks became slow and slower. Eventually, I had to learn about btrfs balancing, write Perl script to perform it, and run the script repeatedly to recover and maintain the disks. Eventually, I got lazy and reinstalled using ext4.


Could you recommend layout for ssd and hdd, that ssd is not
overwritten unnecessarily and ideal filesystem for ssd and hdd.


When SSD's first came out, there was a lot of fuss about minimizing wear and maximizing performance -- disabling swap, over-provisioning, trim, etc.. Since then, SSD's have improved and operating systems have become better at using SSD's. So, I would not worry about Debian wearing out the SSD; just run d-i and let it do the work. Once the system is in operation, some people like to run fstrim(8) periodically (e.g. monthly, weekly).


A key idea that still applies is that your OS and applications should be on one disk and your data should be on another disk. I use SSD's for OS disks (including /home) and I keep the vast majority of my data in a file server (Samba) on HDD's in a ZFS mirror.


A killer feature of d-i is that it can build OS disks with encryption. But, a plaintext "/boot" partition is required to boot the computer.


I prefer to keep my OS images small enough to fit onto "16 GB" devices. This facilitates imaging, cloning, and disaster preparedness. I can save 3 monthly images for 6 computers on a 300 GB USB HDD. But, there is only one active user account on each machine, I must limit how much software I install, I must detach e-mail attachments and save them on the server, and I must keep my home directory usage at a minimum.


Here are my disk partitioning notes from when I installed my Debian 10 daily driver:

        Partitioning method                     manual
Encrypted volume (sda2_crypt) - 1.0 GB Linux device-mapper (crypt)
                 #1             1.0 GB     f  swap          swap
Encrypted volume (sda3_crypt) - 13.0 GB Linux device-mapper (crypt)
                 #1            13.0 GB     f  ext4          /
            SCSI5 (0,0,0) (sda) - 60.0 GB ATA INTEL SSDSC2CW06
                 #1  primary  999.3 MB  B  F  ext4          /boot
                 #2  primary    1.0 GB     K  crypto       (sda2_crypt)
                 #3  primary   13.0 GB     K  crypto       (sda3_crypt)
                               45.0 GB        FREESPACE
        Finish partitioning and write changes to disk

Notes:

1. I am using MBR partitioning, because some of my computers are 14 years old and MBR is the lowest common denominator. I can build a Debian OS disk in one computer and then move the disk (or image) to another computer. (The partition scheme chosen by the d-i is determined by the firmware mode of the computer running d-i -- e.g. BIOS -> MBR, EUFI -> GPT.)

2.  Partition #1 is 1 GB, plaintext ext4 /boot

3.  Partition #2 is 1 GB, encrypted swap (random key)

4.  Partition #3 is 13 GB, encrypted ext4 root (passphrase)


I suggest that you disconnect the HDD (both power and data cables) and install Debian onto the SSD similar to the above. It is best if the SSD has device node /dev/sda. You may want a larger root partition. It is important to have a swap partition; do not eliminate it.


Once Debian is running, I suggest that you connect the HDD, partition the HDD using GPT, create one partition using 95% of available space, initialize a LUKS container inside the partition, and create a ZFS pool with name "data" and with option "copies=2" using the encrypted mapper node. The zpool will be mounted at "/data", will be able to store ~237 GB, and ZFS will be able to survive "one or a few" sectors going bad without any data loss (it is wise to scrub periodically).


David

Reply via email to