LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-30-2009, 08:39 AM   #1
skola
Member
 
Registered: Nov 2009
Posts: 66

Rep: Reputation: 19
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?
 
Old 11-30-2009, 08:48 AM   #2
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by skola View Post
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.
 
Old 11-30-2009, 09:10 AM   #3
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
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.
 
Old 11-30-2009, 06:48 PM   #4
skola
Member
 
Registered: Nov 2009
Posts: 66

Original Poster
Rep: Reputation: 19
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?

Last edited by skola; 11-30-2009 at 06:54 PM.
 
Old 12-01-2009, 12:43 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by skola View Post
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.
 
Old 12-01-2009, 07:29 AM   #6
skola
Member
 
Registered: Nov 2009
Posts: 66

Original Poster
Rep: Reputation: 19
ok ta, confirmed my suspicions
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
swap on cf card with old laptop stan.distortion Linux - Laptop and Netbook 4 04-06-2007 01:50 PM
Do I need SWAP on for my Laptop? mickyg Linux - General 43 02-08-2007 09:18 AM
laptop freezing up, swap disabled? ehawk Linux - Hardware 0 10-04-2004 04:27 PM
Swap-out cd/floppy drive on laptop. acratus Slackware - Installation 4 07-24-2004 03:02 PM
Mandrake 10.0 Laptop Won't Boot Past "Activating Swap Partitions"? Aaron Josephson Linux - Software 0 06-26-2004 09:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration