Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
Hi, is the beginning of a hard disk near the center or at the edge? I want to build another debian pc, and I want to put swap at the ...
  1. #1
    Just Joined!
    Join Date
    Oct 2008
    Posts
    32

    where is the beginning?

    Hi,

    is the beginning of a hard disk near the center or at the edge?

    I want to build another debian pc, and I want to put swap at the edge of the hard disk.
    (fastest access time)

    Thanks.

  2. #2
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    Apparently the edge.

    How much RAM do you have? No matter where the swap is, access times are going to be orders of magnitude slower than RAM. Depending on your Dekstop Environment and how you use your computer, if you have 1 GB+ RAM, odds are you aren't using it all as is.

    Unless I'm running a web browser with multiple tabs open, I never pass 500MB RAM. I've got 3 GB on my laptop, so I've tweaked the swappiness way down so the system greatly prefers RAM to swap.

  3. #3
    Just Joined!
    Join Date
    Oct 2008
    Posts
    32
    I've got 2GB of RAM

    I was thinking of 512MB of swap
    I wil be running VBox on that machine with a 512MB ram for it, so I think I'll be needing swap.

    I am not a Linux expert, but I can work around, what I need.
    I was thnking of using or not using swap (with 2 GB RAM).
    And because I do not know how the system will work without swap, I'll do a test this way:
    I'll create swap on an encrypted partition.
    This way, when I start the pc, if I want the swap to be active, I'll put the password and unlock it.
    If I do not want the swap, then I skip the password and the swap will not be availabe to the system.
    This way I'll see how the system works without swap
    And if later I am happy without the swap, I'll delete that partition and use the empty space to increase the size of an adiacent partition.

    Regards

  4. #4
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    The encrypted filesystem is not the right way to do that.

    As root
    Code:
    swapoff /dev/sd(x)
    swapon /dev/sd(x)
    Where /dev/sd(x) is the swap partition. Turns it off and on respectively.

    All about Linux swap space
    Ubuntu Linux: How to Enable or Disable Swap Partition
    https://help.ubuntu.com/community/SwapFaq

  5. #5
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    you can always create a swap file on an existing partition as well at any point and enable/disable it as needed

  6. #6
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    Quote Originally Posted by HyperUniverse View Post
    Hi,

    is the beginning of a hard disk near the center or at the edge?

    I want to build another debian pc, and I want to put swap at the edge of the hard disk.
    (fastest access time)

    Thanks.
    Where the block count "begins" on an HDD (inner/outer track) has little to do with "access time." Wherever the head happens to be prior to moving to the needed block is all that affects access time.

    While memory and bus speeds have continued to increase, HDD "access times" have remained fairly constant for many years - in the 3 to 10 ms time range. The drop off is so great (in response time and bandwidth) when moving from RAM to swap (HDD), that you will see no difference in performance based on where the swap is located on disk.

  7. #7
    Just Joined!
    Join Date
    Aug 2005
    Location
    Houston, Texas.
    Posts
    57
    Hyper, this is much ado about nothing. Don't let it weight you down. You've got enough Ram that swap will not be used much. And you'll never notice the difference. Just do it.

  8. #8
    Just Joined!
    Join Date
    Oct 2008
    Posts
    32
    Thank you all,

    No swap then (for 2 GB RAM).
    If in the future I need some, I'll just create one as coopstah13 has suggested.

    But I still want to know for sure where is the begining and end of a disk (as it says when you partition the disk).
    The reason is this:
    The disks inside the hard drive are round, everybody knows that (exept my wife).
    I know the disk is spining at 7200rpm, that is 120 rotations per second.
    I never opened a hard drive to look at the size of disks, but let assume that the edge of the disk has a radius of 50mm, and the inner radius is 7mm.
    In this supposed example, ONE inner trak is 2 x pi x 7 = 43.96mm long, lets say it's 50mm long.
    ONE outer trak is 2 x pi x 50 = 314 mm long.
    All the clusters (or whatever is called) where a bit is written, has the same physical size, at the inner as at the outer.
    So lets assume this is taking 1 mm of physical space on the disk.
    That means on the inner track, there'll be 50 bits written/read per one disk revolution; and there will be 314 bits written/read per one disk revolution at the edge.

    So, LOGIC dictates = put all the info that you use most, at the outer edge of your disk, and you'll have a faster access at it, than if you put it at the inner.
    So make a partition for these files at the "begining or at the end" (which is at the edge????).

    I know most of people don't bother about this, but when you move hundreds of GB in a server, daily, then it makes a BIG difference.



    Thanks again.

  9. #9
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    Your simple algebra fails to take into account many factors, including the *big picture.*

    You can *Google* for drive benchmarks. This Raptor shows a max/min transfer rates at ~125/75 MB/sec and an *access time* of ~7ms.

    Now let's look at RAM - DDR3 - with a theoretical throughput of 6.4 - 12.8 GBYTES/sec and access times of a few NANOseconds.

    If you think a server under heavy load that is using swap heavily will "run better" because of swap being on inner/outer tracks, you are mistaken. Once you move from RAM to swap, the access time and thruput has dropped an order of magnitude. That means the difference between 75 > 125 is not even noticeable.

    If the RAM is pushing 12800 MB/sec and thruput drops to 125MB/sec. You are now operating at .9765% of your RAM's thruput. And if swap is 75MB/sec? You are then at .5859% of your RAM's thruput. When you drop from 100% to LESS than 1%, you will not be able to tell a difference between .6 and .9%

    So, LOGIC dictates = put all the info that you use most, at the outer edge of your disk, and you'll have a faster access at it, than if you put it at the inner.
    Locating the data and moving the head to it = access time. Transferring the data from the platter to memory for use = bandwidth/throughput.

    I know most of people don't bother about this, but when you move hundreds of GB in a server, daily, then it makes a BIG difference.
    No, server specs and design dictate *not* getting into swap - not worrying about this tiny difference.

    Depending on the manufacturer and age of the drive, the block count may start on the inner or outer track. So you need to do your own research. Most recent drives I have seen start the block count on the outer track.
    Last edited by HROAdmin26; 12-04-2009 at 03:18 PM.

  10. #10
    Just Joined!
    Join Date
    Jan 2008
    Posts
    53

    Smile where?

    I do not know where is the begining and the end but i know and it has been prove that placing whatever think near of the middle of the disk is faster to be found than placing it at the begining or end.

    So placing the swap in the middle is not a bad idea. I chose to save my thinks at the middle speedy a little when i am searching the swap i do not worry i have not used it few time ago any more but i have it if i need i load it at any time.

    Have luck.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •