Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Dedicate a partition for the whole system or separate it?

Ask for help with issues regarding the Installations of the Debian O/S.
Message
Author
hack3rcon
Posts: 746
Joined: 2015-02-16 09:54
Has thanked: 48 times

Dedicate a partition for the whole system or separate it?

#1 Post by hack3rcon »

Hello,
In the installation process, linux let you to dedicate a partition for "Home" , "usr" and...what is its benefit? It is better to dedicate a partition for a directory like "Home" that store personal data, but how about others?

Thanks.

Chrisdb
Posts: 279
Joined: 2018-04-10 07:16

Re: Dedicate a partition for the whole system or separate it

#2 Post by Chrisdb »

hi,

In most cases for personal use, a separate home partition is useful when you upgrade or reinstall your system, you can choose to leave this partition untouched so you can have a backup

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Dedicate a partition for the whole system or separate it

#3 Post by p.H »

Separate filesystems (not necessarily partitions, can be logical volumes too) allow to use different filesystem types or mount options which are most adapted for each directory contents.
Separate filesystems prevent one directory (mostly /home, /var, /tmp) from filling up all the available disk space.
Separarate filesystems can limit the extent of a filesystem corruption and make backup and restoration easier.

BUT

Separate filesystems make disk space allocation and management more difficult. LVM is strongly advised.

CwF
Global Moderator
Global Moderator
Posts: 2625
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 190 times

Re: Dedicate a partition for the whole system or separate it

#4 Post by CwF »

I like to make the OS as small as possible, including the skeleton of /home, so that a working copy or backup image of the OS is easier to manage. From there it is easy to expand the user directories as mount points for separate devices that can be separately managed and backed up.

If you strip out personal data from /home, the remaining configuration data is not very big. So an image of the OS and the bare /home can be a few gigs up to the smallest common disk size, like <120GB. Then the provided user directories, holding the personal data can be on their own disk, like another disk for ~/Documents, /Pictures, /Videos etc. So those backups of 10TB of videos don't contaminate your ability to back up the OS alone.

IMO, the amount of customization in /home is trivial compared to the tweaks outside Home, so to me that is the unit. Personal data should be the first next block, not /home. So a bootable usb can hold an image of a complete system void of personal data, for me buster is a 1.4GB file. Image that file to a disk, boot and attach personal data disk(s), done.

djk44883
Posts: 107
Joined: 2010-12-11 13:14
Has thanked: 2 times

Re: Dedicate a partition for the whole system or separate it

#5 Post by djk44883 »

Chrisdb wrote:hi,

In most cases for personal use, a separate home partition is useful when you upgrade or reinstall your system, you can choose to leave this partition untouched so you can have a backup
A note, if you upgrade or reinstall, leaving your /home "disconnected", I suspect you allow the upgrade/reinstall to create one, as needed?

So you add mount /home to fstab - so all your old configuration files are still intact, weather or not they may or may not conflict with your upgrade, or reason you reinstalled?? Or do you sort through things first, making it useful?

I have found a method to use a separate filesystem/partition creating a directory holding Documents, Music, Downloads, etc maybe even .themes, and in ~ are symbolic links to these. This keeps my personal files separate allowing any installation to configure user home as needed.

hack3rcon
Posts: 746
Joined: 2015-02-16 09:54
Has thanked: 48 times

Re: Dedicate a partition for the whole system or separate it

#6 Post by hack3rcon »

djk44883 wrote:
Chrisdb wrote:hi,

In most cases for personal use, a separate home partition is useful when you upgrade or reinstall your system, you can choose to leave this partition untouched so you can have a backup
A note, if you upgrade or reinstall, leaving your /home "disconnected", I suspect you allow the upgrade/reinstall to create one, as needed?

So you add mount /home to fstab - so all your old configuration files are still intact, weather or not they may or may not conflict with your upgrade, or reason you reinstalled?? Or do you sort through things first, making it useful?

I have found a method to use a separate filesystem/partition creating a directory holding Documents, Music, Downloads, etc maybe even .themes, and in ~ are symbolic links to these. This keeps my personal files separate allowing any installation to configure user home as needed.
Can you share the method?

User avatar
NFT5
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 596
Joined: 2014-10-10 11:38
Location: Canberra, Australia
Has thanked: 10 times
Been thanked: 41 times

Re: Dedicate a partition for the whole system or separate it

#7 Post by NFT5 »

There are some downsides to doing that with symbolic links.

It's much cleaner to create a folder in /home (e.g. DATA) and then use fstab to mount your data drive/partition to that folder. If /home is on a separate partition to / then it doesn't have to be very big.

If you multi-boot then you can do the same with each OS. That keeps your /home clean with config files only for the OS that it's tied to while your date files are commonly accessible from whichever OS you happen to be using at the time.

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Dedicate a partition for the whole system or separate it

#8 Post by Dai_trying »

If you use a common /home then you might have problems with configs for different OS's, which is why I prefer the method used by djk44883.

User avatar
NFT5
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 596
Joined: 2014-10-10 11:38
Location: Canberra, Australia
Has thanked: 10 times
Been thanked: 41 times

Re: Dedicate a partition for the whole system or separate it

#9 Post by NFT5 »

No, not a common /home. That's a recipe for disaster.

A separate /home for each operating system and then common data drive(s) or partition(s).

Like this:

Code: Select all

chris@BOSSDESK:~$ sudo blkid
/dev/sda1: LABEL_FATBOOT="EFI" LABEL="EFI" UUID="C3A8-EEA4" TYPE="vfat" PARTUUID="18d763ec-f0d2-4bc3-9eb6-aafd4921c843"
/dev/sda2: LABEL="DEB10XFCE-OS" UUID="58a848fe-dbc3-4afc-a9a6-da218204217c" TYPE="ext4" PARTLABEL="DEB10XFCE-OS" PARTUUID="1ba83d88-2840-4bc4-879f-6f0acb2e01b8"
/dev/sda3: LABEL="DEB10XFCE-HOME" UUID="6147aebc-c2b6-4b74-adf9-487e29813d6c" TYPE="ext4" PARTLABEL="DEB10XFCE-HOME" PARTUUID="6df9990d-20db-485d-b0f4-31fdeab291f0"
/dev/sda4: LABEL="D9XFCE-OS" UUID="fefe6dde-4b05-4d97-a384-91a527929d57" TYPE="ext4" PARTLABEL="D9XFCE-OS" PARTUUID="f0163448-0a80-4ee9-8438-1992a67e2a8d"
/dev/sda5: LABEL="D9XFCE-HOME" UUID="090a849c-a90f-4a8c-ae1a-274609da4efc" TYPE="ext4" PARTLABEL="D9XFCE-HOME" PARTUUID="cc94bd7b-24f4-4c38-925f-c87d341fdd4e"
/dev/sda6: LABEL="DEBIAN8-OS" UUID="13b081a7-653e-48e1-b0db-1175f2a6cd66" TYPE="ext4" PARTLABEL="DEBIAN8-OS" PARTUUID="2fbe6f6f-1b11-454d-b80e-03e8f62f0200"
/dev/sda7: LABEL="DEBIAN8-HOME" UUID="09a78e50-1716-49c5-8439-f94f314c62bf" TYPE="ext4" PARTLABEL="DEBIAN8-HOME" PARTUUID="e35ceaf8-57ac-44cf-91d7-89d76548f891"
/dev/sda8: LABEL="DEB10KDE-OS" UUID="e5934d55-007b-4b81-915e-a863ffd7c04d" TYPE="ext4" PARTLABEL="DEB10KDE-OS" PARTUUID="b70939b7-a79f-4401-bf1c-9a83d07a928e"
/dev/sda9: LABEL="DEB10KDE-HOME" UUID="521e731b-da13-4dcd-99e3-14251aa3faf4" TYPE="ext4" PARTLABEL="DEB10KDE-HOME" PARTUUID="7c7658ff-4ed6-4944-8c8f-a864dd32471f"
/dev/sda10: LABEL="SWAP" UUID="fb76a968-8ee2-4277-8eea-2feb628a5852" TYPE="swap" PARTLABEL="SWAP" PARTUUID="65086bbe-7410-4c43-bc90-0bf009a6eb85"
/dev/sdb1: LABEL="DATA2" UUID="a08f0c13-cfe8-4bc2-8ae0-95550ad9ce58" TYPE="ext4" PARTUUID="6e321f73-66c3-4588-acd6-a35fcc312814"
/dev/sdc1: LABEL="DATA" UUID="d295f63a-5933-428b-bbe5-cd8173421d14" TYPE="ext4" PARTUUID="cdddcd13-c42e-45b6-a6d9-c441f50878c3"
In my case the /home partitions are 40GB but that's only because I use a shared Public folder to move virtual machines around the network. Other than that need the /home partitions could be quite small since nothing is actually stored there except for config files.

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Dedicate a partition for the whole system or separate it

#10 Post by Dai_trying »

Sorry I guess I misunderstood the post, probably speed reading which tends to give me 404's in my head :lol:

And I usually keep each OS in it's own single partition just to make it easier for housekeeping (for my methods anyway) but I would not say there is anything wrong with your method, I think both are fine just different :)

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 551
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 75 times
Been thanked: 85 times

Re: Dedicate a partition for the whole system or separate it

#11 Post by wizard10000 »

You know, this thread started me thinking. I think I'm about to move from a separate /home to One Big Partition and a swapfile.

I'm pretty anal about backups - at any given time I have backups on one local drive, two on different spindles on my home server and one backup in the cloud and they all update nightly. It's been years since I broke Debian badly enough to justify a reinstall so I'm beginning to question the wisdom of continuing to maintain a separate /home partition. I'm really not interested managing partitions on the fly and have a pretty solid backup strategy so I don't really see a use for LVM.

Anyway, this weekend I think I'm gonna move home back to the root partition, kill the swap partition, add a swapfile and resize the root partition to fill up the disk.

Anyway, like I said this thread started me thinking :mrgreen:
we see things not as they are, but as we are.
-- anais nin

User avatar
4D696B65
Site admin
Site admin
Posts: 2696
Joined: 2009-06-28 06:09
Been thanked: 85 times

Re: Dedicate a partition for the whole system or separate it

#12 Post by 4D696B65 »

wizard10000 wrote: Anyway, this weekend I think I'm gonna move home back to the root partition, kill the swap partition, add a swapfile and resize the root partition to fill up the disk.
Great idea but Microsoft thought of it first. :mrgreen:

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Dedicate a partition for the whole system or separate it

#13 Post by Dai_trying »

My backup strategy is to only backup my DATA partition which is sym-linked to all OS's, since I can re-install any OS (the ones I use anyway) with my required software in around 30 - 45 minutes I think restoring an OS from backup would probably take longer.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Dedicate a partition for the whole system or separate it

#14 Post by p.H »

wizard10000 wrote:kill the swap partition, add a swapfile
Do think twice before doing that. Linux was designed to use raw block devices as swap space, and still is. Using swapfiles with Linux is a hack. A dirty one. It does not work natively on filesystems types which do not allow to map files to physical blocks, use copy-on-write, and so on ; making it work natively on some of them (NFS, Btrfs) has required heavy intrusive kernel patching. The only clean way to use a swap file would be through a loop device, which incurs a performance penalty.

CwF
Global Moderator
Global Moderator
Posts: 2625
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 190 times

Re: Dedicate a partition for the whole system or separate it

#15 Post by CwF »

When ports and drives are plentiful,

Code: Select all

root@sarah:/var/log#  blkid
/dev/mapper/sda5_crypt: UUID="BX....Q" TYPE="LVM2_member"
/dev/mapper/sarah--vg-root: UUID="10....0" TYPE="ext4"
/dev/sda1: LABEL="dvr" UUID="56....f" TYPE="ext4" PARTUUID="6ee26032-01"
/dev/sdb1: LABEL="pasture" UUID="26....7" TYPE="ext4" PARTUUID="48df53c9-01"
/dev/sdc1: LABEL="USB_POOL" UUID="E897-A125" TYPE="vfat"
/dev/sdd1: UUID="41....2" TYPE="ext2" PARTUUID="56854b99-01"
/dev/sdd5: UUID="e1....3" TYPE="crypto_LUKS" PARTUUID="56854b99-05"
/dev/sde1: LABEL="Media" UUID="D0....0" TYPE="ntfs" PARTUUID="dec171a6-01"
/dev/sdf1: LABEL="meadow" UUID="a8....6" TYPE="ext4" PARTUUID="fdcc92f3-01"
/dev/mapper/sarah--vg-swap: UUID="95....03" TYPE="swap"
I have flipped, and agree a dedicated swap partition is best when you need swap. In VM's I use no swap at all with memory ballooning available.
I don't partition at all, only for LVM purposes,

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 551
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 75 times
Been thanked: 85 times

Re: Dedicate a partition for the whole system or separate it

#16 Post by wizard10000 »

p.H wrote:Do think twice before doing that. Linux was designed to use raw block devices as swap space, and still is. Using swapfiles with Linux is a hack. A dirty one. It does not work natively on filesystems types which do not allow to map files to physical blocks, use copy-on-write, and so on ; making it work natively on some of them (NFS, Btrfs) has required heavy intrusive kernel patching. The only clean way to use a swap file would be through a loop device, which incurs a performance penalty.
I did not know this. Advice greatly appreciated :)
we see things not as they are, but as we are.
-- anais nin

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 551
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 75 times
Been thanked: 85 times

Re: Dedicate a partition for the whole system or separate it

#17 Post by wizard10000 »

4D696B65 wrote:Great idea but Microsoft thought of it first. :mrgreen:
:mrgreen:

One day I'll tell the story of how I got this brilliant idea to put a Win 3.1 swapfile on a ramdrive.

I was an amateur geek at the time and my other geek friends were too kind to point out this is probably the dumbest thing anyone's ever done with a computer :)

Oops. Looks like I just told the story :P
we see things not as they are, but as we are.
-- anais nin

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Dedicate a partition for the whole system or separate it

#18 Post by p.H »

wizard10000 wrote: put a Win 3.1 swapfile on a ramdrive (...) is probably the dumbest thing anyone's ever done with a computer
Note that the idea of putting swap space in a RAM disk has come back with modern Linux kernels using zram, which is a compressed block device in RAM. According to reports, it seems quite efficient.

CwF
Global Moderator
Global Moderator
Posts: 2625
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 190 times

Re: Dedicate a partition for the whole system or separate it

#19 Post by CwF »

Yep, I like the zram idea, I does make sense. The swap just isn't for running out of memory. Some things expect to manage more data overall than it does at a single time, and expects to do it without the ram for all. Some things in memory taking space and nothing has ask for a reference for days, maybe we should move it out... So with a high memory load we might find a few gigs of seldom used memory that could be compressed, releasing memory for use. If the exchange was 1:1 it wouldn't make sense, but it's not.

At some point I expect to see compressed swap in memory to be larger than installed memory for some. At that scale it's a great idea. The recall time to decompress back into memory, from memory, is way faster on a modern cpu than any other device based swap.

djk44883
Posts: 107
Joined: 2010-12-11 13:14
Has thanked: 2 times

Re: Dedicate a partition for the whole system or separate it

#20 Post by djk44883 »

hack3rcon wrote: Can you share the method?

Code: Select all

#!/bin/bash
#make home
cd /media/shared
mkdir homelinks
cd homelinks
mkdir Documents
mkdir Downloads
mkdir Music
mkdir Pictures
mkdir Videos
mkdir .icons
cd ~
rmdir Documents
rmdir Downloads
rmdir Music
rmdir Pictures
rmdir Videos
rmdir .icons
ln -s /media/shared/homelinks/Documents
ln -s /media/shared/homelinks/Downloads
ln -s /media/shared/homelinks/Music
ln -s /media/shared/homelinks/Pictures
ln -s /media/shared/homelinks/Videos
ln -s /media/shared/homelinks/.icons
Let me say...this has beginning all the way back when I was transitioning off Windows. I had a "shared" partition so I could access files from either system - of course not sym links then. Later, I was transitioning from an overly user-frinedly linux to grown-up debian, multi-boot system. Again so I could access files from either system. I was learning as I went along, may not be ideal, but was working. So, I may, or may not have cleaned it up some if I'd start all over again.

I did see this "tip" somewhere, I saw some logic in it even for a single OS system. It's work, at least, from Jessie, Stretch, and now Buster - stable Debian.
Last edited by djk44883 on 2019-08-21 20:12, edited 1 time in total.

Post Reply