0

Hellow everyone, I have a 7 year old computer where I've been using Windows all the time and after transitioning to Linux in a laptop, I've decided to install it on the desktop too.

I have an ssd (128gb)and three hdds (2,2 and 1tb), which I've been using with Windows installed on the ssd and using the hdds as normal drives.

I wondered if I could benefit from using raid technology (and how) and also the way to setup a partition table for the system.

Thanks

0

The answer you are looking for is Logical Volume Management. That is the tools of LVM2.

Overview: Partitions are managed in Physical Volume Groups. With these PV-Groups you are able to create Volume Groups (VG). Within them (VG) you can create Logical Volumes, which represent your usual partitions / filesystems.

There are many things you can gain from this, e.g. extending storage/partitions over the actual size of the physical HDD, Mirroring (RAID-Layouts) or even creating partitions in programs when necessary. Anyways, there is plenty to learn about but I suggest you just start with three partitions, check the first table (example) of the above wiki.

In your specific case: One fixed boot partition, outside the scope of LVM2. One partition on your SSD, suggesting to hold binaries and one partition for heavy-written data (run, var, userdata, like home) on your HDD.

Outlook: You can always resize the partitions, after unmounting them.

I suggest you read in advance about the fstab-file and mkfs.utilities to manifest a bit of understanding.

It is really straightforward. Have fun :- )

// edit: I updated links, text and layout of the post. To answer your following question if you need to do this before installing Linux: You do not. If you have available partitions to transfer data temporarily to, you can easily change all your partitions into using LVM2. For this one can make use of rsync.

Note on rsync: Do not copy files (that is dirs like /proc) written at boottime from the linux kernel to the new partition. Use its exclude pattern. edit the fstab file before rebooting or update grub via chroot.

But nowadays every major Linux distro (not aware about BSD) will enable you to partition your hard discs using LVM when installing. Check this additional link for a hands-on outline setting up LVM: https://www.tecmint.com/manage-and-create-lvm-parition-using-vgcreate-lvcreate-and-lvextend/

summarizing

  1. choose and create a partition schema (e.g. GPT, for example using fdisk)
  2. the Debian wiki suggests one partition outside LVM for boot, I suggest another one if you want to use Windoof alongside. => Within fdisk /dev/sdX you create three new partitions.
  3. write out the table to the disk.
  4. mkfs.ext4 or mkfx.vfat for making a filesystem on the two partitions outside of LVM scope. (4b. label them if wished, e.g. using e2label
  5. proceed with LVM instructions, where you now can use /dev/sdX3 and your other hard disks.

The provided wiki is extensive and very easy to understand. All these steps can be supported by any major distro install-utility. You just need to be aware of the 1. partition schema 2. your LVM schema (that is, you can start with an 50G LVM install and adapt your setup from within the CLI. The fstab file declares where devices should be mounted when booting.

Note about fstab: You can refer within the fstab file devices by their path /dev/sdX3, their UUID=12352-...-3254 or LABEL=EX_LABEL. Make use of the LVM commands (pvdisplay) (vgdisplay) -> lvdisplay
NOTE THAT YOU NEED TO USE lvm mount option in your fstab to mount LVM at boot. Name it at the beginning of the mount options. Refer to man pages to build up your kownledge.

| improve this answer | |
  • Thank you very much for the answer, it looks like a great tool, could you point me to any place that could provide me with a further and deeper understanding of the actual process that I have to follow? Is this created before or after Linux is Installed? I still have a lot of questions haha. – Doma17 Mar 27 at 1:51
  • I updated my comment @Doma17. There are tons of guides for LVM specific for your distro of choice, but my post should be extensive enough for conquering the topic on your own. Just try it on an old usb stick. – Tomes Mar 27 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.