Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rate Thread Display Modes
Old 12-02-2002, 02:21 PM   #1
sTvN
Prospect
 
Join Date: Aug 2002
Posts: 17
Question Partition and Swap File Question

I have some partition and swap file questions. I just got a powerbook and want to set it up to use a swap file. I haven't done this before. I'm planning on having a Mac OS X partition, Classic partition, and swap partition. I know how to create partitions (duh) but am not sure how I point the swap file to its dedicated partition under 10.2.2. Where can I read how to do this for 10.2? Are there any other things I should do when setting up a new machine? Does my set up idea seem wise?

My family needs my old computer (Blue and White G3). In it I have a 7200 rpm 40 gb HD and a 5400 rpm 30 gb HD. I'm going to install 10.2.2 on the faster 40 gb drive, but where should I install Classic and more importantly put the swap file? Would the swap file perform faster on a partition on a 7200 rpm drive where the system is or on it's own dedicated, but slower, 5400 rpm drive?

Any help or pointers would be very much appreciated. Please point me to websites or threads that contain this information.

Thanks,
Steven
sTvN is offline   Reply With Quote
Old 12-02-2002, 04:04 PM   #2
WillyT
Major Leaguer
 
Join Date: Jan 2002
Location: Midwest Not quite Normal
Posts: 407
Put SWAP partition on a different drive.

Steven

You really need to put the SWAP partition on a separate drive from the boot drive. Which leaves out getting any actual advantage for portables. Having the SWAP partition on the same drive will lead to thrashing and slow down the system.

I'm running a 400MHz G4 with 10G and 60G drives. The boot drive is the 60 partitioned into 10G slots and the SWAP partition is 1G of the 10G drive.

Here is a portion of my /etc/rc file.
Code:
##
# update flushes the cached blocks from the filesystem using
# the sync system call every 30 seconds.  This ensures the
# disk is reasonably up-to-date in the event of a system crash.
##

update

##
# Start the virtual memory system.
##

ConsoleMessage "Starting virtual memory"

#swapdir=/private/var/vm

# Explicitly mount swap volume
mount -t hfs /dev/disk0s10 /Volumes/SWAP

swapdir=/Volumes/SWAP/vm
if [ "${netboot}" = "1" ]; then
    sh /etc/rc.netboot setup_vm ${swapdir}
fi

# Make sure the swapfile exists
if [ ! -d ${swapdir} ]; then
    ConsoleMessage "Creating default swap directory"
    mount -uw /
    mkdir -p -m 755 ${swapdir}
    chown root:wheel ${swapdir}
else
    rm -rf ${swapdir}/swap*
fi
                    
dynamic_pager -H 40000000 -L 160000000 -S 80000000 -F ${swapdir}/swapfile


##
# Start daemon to fix incorrectly-prebound binaries
##
    if [ -x /usr/libexec/fix_prebinding ]; then
        /usr/libexec/fix_prebinding
    fi
Before changing your /etc/rc file to match run df to see how you system normally mounts the drives. I suggest rebooting several times to see if the mount points change.

I always boot to single-user and check that the drives mounted "correctly". This isn't a problem as I reboot for installs only (almost never any other time). Do your fsck -y AND fsck_hfs -y /dev/disk0s9 (use the up arrow for history and edit to fsck_hfs -y /dev/disk0s10 etc...

Exit to continue to login screen.

Should work on your G3 (assuming no SCSI problems)

Willy
WillyT is offline   Reply With Quote
Old 12-02-2002, 05:55 PM   #3
sTvN
Prospect
 
Join Date: Aug 2002
Posts: 17
Thanks but how?

Thank you for your input. Where then can I read about how to switch the swap file for 10.2. I've never done it before.

Thanks.
sTvN is offline   Reply With Quote
Old 12-02-2002, 08:08 PM   #4
WillyT
Major Leaguer
 
Join Date: Jan 2002
Location: Midwest Not quite Normal
Posts: 407
Steven

Just create the partition and name it SWAP.

Reboot.

type df <return> in the terminal

Note the mount point.

Mine is /dev/disk0s10 and /Volumes/SWAP

Reboot several times to discover the "normal" mount point as it WILL change.

In the terminal type (makeing sure of the spaces)

sudo cp /etc/rc /etc/rc.old

sudo pico /etc/rc

Edit the file so the above posted section looks simular to mine using YOUR values from df.

then <ctrl> + O (command to write Out the file changes)

a <return> to accept the filename

then <ctrl> + X (command to exit pico)

Reboot to single user mode hold <CMD> + S after the startup chime till text scrolls on the screen.

do the fsck stuff checking that the mount points look ok!(if not either reboot or edit the /etc/rc file to reflect the change ie. mount -uw / and then pico /etc/rc. You don't use sudo in s-u mode as you ARE ROOT be carefull)

then type exit<return> to go on to the login screen.

Others may use different methods with fstab or automount

If you are not comfortable with this as with ANY mods to system files don't do it till you understand and are ok with the consequences.

Willy

ps you can search the forums for "swap"
WillyT is offline   Reply With Quote
Old 12-02-2002, 09:12 PM   #5
petey
All Star
 
Join Date: Feb 2002
Location: peteyville
Posts: 794
willy,

putting the swap partition on the same drive as the system certainly doesn't slow things down.

that's bad advice.
petey is offline   Reply With Quote
Old 12-02-2002, 09:50 PM   #6
WillyT
Major Leaguer
 
Join Date: Jan 2002
Location: Midwest Not quite Normal
Posts: 407
Flame on?

petey

Not worth the bother. As some don't believe swap on a different drive makes any difference either. "Better to just get more RAM"

The thrashing depends on how many partitions, platters, heads, interleave, and possibly fragmentation. Probably just as much chance for thrashing with the standard swap. Its just if you want to see improved response subjective or otherwise a separate drive is the way to go.

So as I see it with only one drive its six for one and a half dozen for the other.

I apologize if my opinion looked too much like a given fact.
Willy
WillyT is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 12:56 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.