LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   laptop swap, best placement? (https://www.linuxquestions.org/questions/linux-newbie-8/laptop-swap-best-placement-772439/)

skola 11-30-2009 07:39 AM

laptop swap, best placement?
 
Desktops and exotic laptops aside, with 1 drive in a laptop is there a preferred position for the swap partition?

Looking at some install notes and faqs suggests head left->right:

/boot /swap /home /

what about as last: /boot /home / /swap

some backup imaging tools won't do the swap and this makes a same layout restore onto a fresh or wiped hdd tricky at best. Having swap at end precludes that hassle.

whadya think?

ozanbaba 11-30-2009 07:48 AM

Quote:

Originally Posted by skola (Post 3774329)
Desktops and exotic laptops aside, with 1 drive in a laptop is there a preferred position for the swap partition?

Looking at some install notes and faqs suggests head left->right:

/boot /swap /home /

this position makes repartitioning easier, but do we repartition our dist "ever day"? not really and you can safely delete swap and make it again.
maybe it would bring some performance benefites. but linux does not uses much swap.

Quote:

what about as last: /boot /home / /swap

some backup imaging tools won't do the swap and this makes a same layout restore onto a fresh or wiped hdd tricky at best. Having swap at end precludes that hassle.

whadya think?
i don't even use boot partition, but it may be needed in some places. use it if you want to.
dd + bzip2 is nice way to do back-up whole disk with partition level. but lilo may not like it. grup would like it.

i use this / swap on same disk /home on different disk.

malekmustaq 11-30-2009 08:10 AM

Quote:


laptop swap, best placement?
Desktops and exotic laptops aside, with 1 drive in a laptop is there a preferred position for the swap partition?

Swap can be positioned anywhere, be it primary or logical partition it can do the job. However, to my personal preference, considering hardisk head works I always place Swap drive immediately or near the root drive where most disk read/write traffic occur.

Quote:

Looking at some install notes and faqs suggests head left->right:
/boot /swap /home /
what about as last: /boot /home / /swap

Positioning Swap in-between / and /home partitions is wise. (By this you have three successive partitions: Partition1 (Root) + Partition2 (Swap) + Partition3 (/home).

Quote:

some backup imaging tools won't do the swap and this makes a same layout restore onto a fresh or wiped hdd tricky at best. Having swap at end precludes that hassle.
whadya think?

You don't need backup your Swap partition, only your system and user data. Having swap at the end of hardisk still works; this is a matter of taste.

Hope this helps.

Good luck.

skola 11-30-2009 05:48 PM

ok fair enough you guys :) thanks

Sure with enough ram swap isn't accessed much. I'm aware of using 'dd' for pure sector copy and in fact a few tools use that under the surface. Playing with some practice installs I recollect one didn't like a slightly resized layout on a restore where the UUID changed.

Actually, thought of another point and maybe stay in this thread.

Have you had 1 or more extra distros sharing a /swap and would that cause trouble if there had been any suspend and then a normal boot trying to 'resume' ?

sounds like just have a 2nd /swap eh?

catkin 11-30-2009 11:43 PM

Quote:

Originally Posted by skola (Post 3774973)
ok fair enough you guys :) thanks

Sure with enough ram swap isn't accessed much. I'm aware of using 'dd' for pure sector copy and in fact a few tools use that under the surface. Playing with some practice installs I recollect one didn't like a slightly resized layout on a restore where the UUID changed.

Actually, thought of another point and maybe stay in this thread.

Have you had 1 or more extra distros sharing a /swap and would that cause trouble if there had been any suspend and then a normal boot trying to 'resume' ?

sounds like just have a 2nd /swap eh?

Apart from considerations about re-organising/sizing partitions the "best" placement depends on how much I/O is being done to each partition and that depends on how you use your system so best measure it. If you have enough memory, swap is a seldom-used insurance, so not performance critical.

For suspend to work you must have enough free space in swap to accept the contents of memory plus a little. The only way to guarantee this is to have a separate swap for suspend; presumably it must have enough space to accept the contents of memory plus any used swap space. If resume is to work the contents of swap-for-suspend must be untouched after suspend until resume. For a multi-boot system that implies a swap-for-suspend partition for each bootable OS.

skola 12-01-2009 06:29 AM

ok ta, confirmed my suspicions :)


All times are GMT -5. The time now is 05:04 PM.