dslreports logo
 
    All Forums Hot Topics Gallery
spc
Search similar:


uniqs
435

aurgathor
join:2002-12-01
Lynnwood, WA

aurgathor

Member

Partitions meeded for Linux

I vaguely remember needing a separate swap partition last time I used Linux (in the 90s) -- is that still true, or advantageous?

If yes, what is the recommended amount of swap space, and what should be the partition type for the primary partition. (I presume the swap space, if separate, should be linux-swap)

The target drive is a 120 GB SSD, currently with a single FAT32 partition, but I can make anything supported by GPARTED. The system will be dual booting with the other, primary OS being Win7-64 (currently Win7-x86) and that resides on a separate 256G SSD. Memory right now is only 2G, but it should go up to at least 6G, if not 8G. And 8G is the maximum amount the mobo can hold.

Currently, I have Slackware 14.1 on a DVD, but I'll probably try a few more distros.

TIA

shdesigns
Powered By Infinite Improbabilty Drive
Premium Member
join:2000-12-01
Stone Mountain, GA

shdesigns

Premium Member

Just free up space and let the disro choose the types.

Usually swap is the same size as RAM.

rolfp
no-shill zone
Premium Member
join:2011-03-27
Oakland, CA

rolfp to aurgathor

Premium Member

to aurgathor
The rule use to be 2x ram for swap, up to about 1G. Ram has become so cheap for a normal desktop (I have 16G) that you can find advice that swap isn't needed. I make 2G swap, anyway, for corner cases.

You'd be well served to make a separate /home partition for personal files and settings as it can be carried forward if/when you update the system or install a different distro. The size of /home can be whatever you can spare after you designate space for / ("root partition"). I have a 1.6T /home, currently, 1.3T used with 15 years of records and media files.

My current / on a kitchen sink installation with lots of third-party apps, development libraries for building programs, stuff installed just to try it and left, uses 8.9G. I don't think I've ever had 10G in / as long as /home, which is where the bulk of files accumulate, is separate. Usually, I designate 20G or so for /, as storage space is not an issue. I've got a 27G reiserfs /, 2/3 empty, for my daily Linux install plus a 30G XP partition on a 64G ssd with large mechanical hdd's for other storage.

I've used reiserfs for the Linux filesystem for 15 years as it has never gone corrupt on me, even through power outages or bad shut-downs. It seems to have a very robust journalling and self-repair design. I only had to do a manual repair once or twice in that time. Probably, ext4 is good but I haven't felt a need to use anything but reiserfs.

nwrickert
Mod
join:2004-09-04
Geneva, IL

nwrickert to aurgathor

Mod

to aurgathor
Separate swap is usually still recommended.

If you have enough memory, you might not use the swap. However, if you ever want to hibernate, then the hibernation data goes to swap. If you are planning to add memory, then make swap as big as you expect memory to eventually be (to accomodate hibernation).

Beyond that, I usually recommend "/home" as a separate partition. That way you can reinstall the operating system, or switch to a different distro, while retaining user data.

Personally, I also use a separate "/boot". But that's because I use encryption, and "/boot" is the unencrypted part of the disk needed to get things started.

aurgathor
join:2002-12-01
Lynnwood, WA

aurgathor

Member

quote:
Just free up space and let the disro choose the types.
The install is prompting me to use 'fdisk' or 'cfdisk' to create the partitions....

Anyhow, it's 30G boot (ext4), 80G home (ext4), 9.25G swap for now.

Thanks for all who replied

nwrickert
Mod
join:2004-09-04
Geneva, IL

nwrickert

Mod

said by aurgathor:

The install is prompting me to use 'fdisk' or 'cfdisk' to create the partitions

It's been a while since I last used slackware. But that does sound familiar.

Your partition sizes look reasonable from here.
OZO
Premium Member
join:2003-01-17

OZO to aurgathor

Premium Member

to aurgathor
Guys, I think you'd agree, that for dual boot systems it'd be nice to use the same HD space for Windows swap (pagefile.sys file) and Linux swap (dedicated partition). They both serve the same purpose and they are used only when the respective OS is running...

Is there any way to use the same HD space for both of them?

In Windows it's possible to place its swap file on any partition. But I think it requires NTFS (hope I'm wrong here). What are special requirements for Linux swap partition?

shdesigns
Powered By Infinite Improbabilty Drive
Premium Member
join:2000-12-01
Stone Mountain, GA

shdesigns

Premium Member

you can have a small NTFS partition and use a swap file in linux.

They could be the same file, but hibernate would not work in either OS. You could make one partition and fill it with just two swap files.

Pjr
Don't Panic
join:2005-12-11
UK

Pjr to aurgathor

Member

to aurgathor
said by aurgathor:

Anyhow, it's 30G boot (ext4)

Do you mean "boot" or "root"? 30GB for a boot partition is through overkill and out the other side. Currently /boot occupies 49 MB on my PC.

Rexter
Libertas, Aequitas, Veritas
join:2002-11-17
cloud 9

Rexter to OZO

Member

to OZO
said by OZO:

it'd be nice to use the same HD space for Windows swap (pagefile.sys file) and Linux swap (dedicated partition

I looked into this on my dual boot systems, and decided that it wasn't worth if for my purpose. I do want to be able to hibernate, so you can't have your Linux swap on the NTFS partition for that. If you want to be able to access any of the NTFS partitions from Linux you have to make sure Windows Hibernation is disabled, otherwise the NTFS partitions won't mount. Also, he swap file on NTFS has significantly decreased performance because of the inefficient NTFS format, as well as file fragmentation. I'd be interested to know if anyone finds a use case for this, where it does make sense.

aurgathor
join:2002-12-01
Lynnwood, WA

1 recommendation

aurgathor to Pjr

Member

to Pjr
Oh, that 30GB is for /root, which I think is also includes /boot in my case.
OZO
Premium Member
join:2003-01-17

OZO to Rexter

Premium Member

to Rexter
Rexter See Profile, thank you for looking into this.

To make it clear, what we're talking about is 4 (rather significant) HD spaces:
pagefile.sys file - swap in Windows
/swap partition - swap in Linux
hiberfil.sys file - used for hibernation in Windows
/swap partition - presumably used for hibernation in Linux

Of course, the last two items are important and should be kept separate for each OS. The idea is to combine only swap space (first two items).If Linux swap is always used to keep hibernate data, the idea is not working at all (because we have to keep the hibernate data separate for two OS's). But if it's possible in Linux to separate swap from its hibernate data, it'd be interesting to reuse the swap space in both OS's... Second, you've mentioned that NTFS, even if it can hold swap for Linux, NTFS is not efficient enough for its work. If that's true, the whole idea becomes futile and we have to use 4 different (and again, significant) spaces on HD for all of those items...

shdesigns
Powered By Infinite Improbabilty Drive
Premium Member
join:2000-12-01
Stone Mountain, GA

shdesigns

Premium Member

If the swap files are the only thing on the partition, it will be fast enough.

Rexter
Libertas, Aequitas, Veritas
join:2002-11-17
cloud 9

1 edit

Rexter

Member

You're right. Just as an example, lets say you have 8GB ram so you create a 12GB NTFS partition designated for SWAP. Fragmentation shouldn't be an issue, because it's not mixed with the system or user data. Now you have a Linux swap file, pagefile.sys, and hiberfil.sys. I think hiberfil.sys always goes to the root of C:, so it shouldn't be a problem, but I'm not 100% on that. Now you can point both Windows, and Linux to the 12GB NTFS partition for page-file, and swap file. I'm betting that you'd need each OS to delete it's respective swap file during the shut-down procedure to free up the space for the other. It's my understanding that Linux hibernation is only supported on the SWAP partition, so you couldn't hibernate your Linux session. Doing a hibernate in Windows would work because the hiberfil.sys is separate, but your Linux session would be messed up for two reasons. The pagefile.sys would still filling the NTFS swap partition, with no room for your Linux swap file. Okay, so what if you had Linux delete pagefile.sys during the start-up? Well you can't. Your fstab setting to mount the 12GB partition would fail because it’s marked dirty by the hibernated Windows system. Same thing would happen if Windows was shut-down in an unclean manner. Linux couldn't mount the 12GB NTFS partition until you booted Windows, and then did a clean shut-down.

When I say I looked into this, I mean I tried it. I'm speaking from experience here.
Rexter

Rexter to OZO

Member

to OZO
said by OZO:

Second, you've mentioned that NTFS, even if it can hold swap for Linux, NTFS is not efficient enough for its work.

It's not a matter of not being efficient enough, it's just not as efficient as a native Linux SWAP partition, and it's really messy, as I pointed out in my post above.