Dedicate a partition for the whole system or separate it?

Help with issues regarding installation of Debian

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

Postby wizard10000 » 2019-08-21 11:54

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
 
Posts: 63
Joined: 2019-04-16 23:15
Location: southeastern us

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

Postby wizard10000 » 2019-08-21 11:58

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
User avatar
wizard10000
 
Posts: 63
Joined: 2019-04-16 23:15
Location: southeastern us

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

Postby p.H » 2019-08-21 12:11

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.
p.H
 
Posts: 1080
Joined: 2017-09-17 07:12

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

Postby CwF » 2019-08-21 15:25

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.
CwF
 
Posts: 442
Joined: 2018-06-20 15:16

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

Postby djk44883 » 2019-08-21 19:47

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.
djk44883
 
Posts: 80
Joined: 2010-12-11 13:14

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

Postby djk44883 » 2019-08-21 20:01

NFT5 wrote: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.

I could just mount a single folder in /home which is on yet another partition then /, that's an option. I was keeping the system all on 1, keeping /home intact for upgrade/re-installation, or at least mounting /home for this... either way size is irreverent to mount point.

NFT5 wrote: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.


If I multi-boot, and want to see my pic no matter witch system I'm in? Or listen to music... regardless of booted system?
djk44883
 
Posts: 80
Joined: 2010-12-11 13:14

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

Postby djk44883 » 2019-08-21 20:11

p.H wrote:
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.


Linux was designed when memory was expensive and systems had little. Unless you hibernate, you don't really need large swap space if you have like 4, 8 or GB of RAM... for a home personal use?

Debian's Wili does have a section for a swap file https://wiki.debian.org/Swap but never mention it's a hack.
djk44883
 
Posts: 80
Joined: 2010-12-11 13:14

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

Postby p.H » 2019-08-22 18:02

But it says a dedicated swap partition is recommended. There must be a reason.

I recommend the reading of the mkswap and swapon man pages. To summarize, swap files are a violation of the filesystem layer.

Ever seen how you tell the kernel about a swap file to use for resume from hibernation ? You don't pass the swap file path, no, no. You pass the partition containing the file and the offset between the first block of the partition and the first block of the swap file. Doesn't this look enough like a hack for you ?
p.H
 
Posts: 1080
Joined: 2017-09-17 07:12

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

Postby djk44883 » 2019-08-22 18:54

p.H wrote:But it says a dedicated swap partition is recommended. There must be a reason.

I recommend the reading of the mkswap and swapon man pages. To summarize, swap files are a violation of the filesystem layer.

Ever seen how you tell the kernel about a swap file to use for resume from hibernation ? You don't pass the swap file path, no, no. You pass the partition containing the file and the offset between the first block of the partition and the first block of the swap file. Doesn't this look enough like a hack for you ?


I did comment, unless you need hibernation... Then yea, I'd go for a large partition as well. If I have gigs of ram, not hibernating, there's not much need for swapping, but some reason to have a minimal amount. One of the great things about linux systems, it's not a one-size-fits-all.
djk44883
 
Posts: 80
Joined: 2010-12-11 13:14

Previous

Return to Installation

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable