LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-30-2005, 10:04 AM   #1
Ahmed
Member
 
Registered: May 2005
Location: München, Germany
Distribution: Slackware, Arch
Posts: 386

Rep: Reputation: 41
Question Moving a swap partition?


Sorry that I posted this here, but I didn't know where else this should go..

I have an 80GB hard disk with Fedora Core on /dev/hda1, the swap partition on another primary partition, an extended partition (Fat32), and thus only one primary partition left.

Now I want to install either Solaris or FreeBSD on that last primary partition. Both of them have to be installed on primary partitions, so I suppose I'll need another primary partition to be used as a swap partition.

My question is: Is it possible to "move" the Linux swap partition to another position on the hard disk? I was thinking of creating a new partition on the extended partition and using that as my new Linux swap, and formatting the old one on the primary partition to use as a Solaris/BSD swap partition. Is that possible without reinstalling Fedora?

Thanks a lot

-A

Last edited by Ahmed; 09-30-2005 at 10:06 AM.
 
Old 09-30-2005, 10:18 AM   #2
-X-
Member
 
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
Can be done. You must have an really big swap partition to install another OS on it. How big is your swap? Do fdisk -l and show that here, lets see what you have before you get started.

Anyway, swap can be on the extended. Use mkswap /dev/<whatever>, then swapon. man both for more details. Then make changes in /etc/fstab and reboot.
 
Old 09-30-2005, 10:20 AM   #3
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Check your /etc/fstab and you will see where the swap is defined:

Code:
/dev/hdb2            swap                 swap       pri=42                0 0
You don't need to "move" any data that is on there. Just unmount the swap partition and mount the new one (man swapon, man swapoff). The man files are so straightforward that I think you can take it from there even if you're a beginner, since you appear to understand partitions. Also FYI, you can also create a file and mount the file for swap space if you prefer. You can even share a swap file with Windows if you're feeling adventurous, and if Windows is configured to used a fixed size swap file.
 
Old 09-30-2005, 10:28 AM   #4
Ahmed
Member
 
Registered: May 2005
Location: München, Germany
Distribution: Slackware, Arch
Posts: 386

Original Poster
Rep: Reputation: 41
This is how my fstab looks like:

Code:
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/                 /                       ext3    defaults        1 1
/dev/devpts             /dev/pts                devpts  gid=5,mode=620  0 0
/dev/shm                /dev/shm                tmpfs   defaults        0 0
/dev/proc               /proc                   proc    defaults        0 0
/dev/sys                /sys                    sysfs   defaults        0 0
LABEL=´$Á–ÁŽ:ñO‚
   swap                    swap    defaults        0 0
/dev/hda5		/home/bass/A		vfat	noauto,utf8,users,exec,umask=000 0 0
/dev/hda6		/home/bass/B		vfat	noauto,utf8,users,exec,umask=000 0 0
/dev/hda7		/home/bass/MP3s		vfat	noauto,utf8,users,exec,umask=000 0 0
/dev/fd0                /media/floppy           auto    pamconsole,exec,noauto,managed 0 0
/dev/hdc                /media/cdrecorder       auto    pamconsole,exec,noauto,managed 0 0
/dev/hdb                /media/cdrom            auto    pamconsole,exec,noauto,managed 0 0

I have no idea what those strange symbols mean or why they're there. Anyway if I create a swap partition using QTParted or whatever on (let's say) /dev/hda7 , I suppose the fstab entry should be:

Code:
/dev/hda7            swap          swap    defaults        0 0
Am I right? And BTW, I have a 1GB swap partition (because of 512 Ram)

Thanks again

-A

Last edited by Ahmed; 09-30-2005 at 10:31 AM.
 
Old 09-30-2005, 10:35 AM   #5
-X-
Member
 
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
Yes you have the general idea, You're not going to do much with 1g for an OS. If you have room, maybe reorder a few things. What does fdisk -l and df -h show?
 
Old 09-30-2005, 11:25 AM   #6
Ahmed
Member
 
Registered: May 2005
Location: München, Germany
Distribution: Slackware, Arch
Posts: 386

Original Poster
Rep: Reputation: 41
dh -f shows:

Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda1             8.5G  6.8G  1.4G  84% /
/dev/shm              252M     0  252M   0% /dev/shm
/dev/hda5             9.7G  7.4G  2.4G  76% /home/bass/A
/dev/hda6              18G   15G  2.9G  84% /home/bass/B
/dev/hda7              21G   11G   11G  51% /home/bass/Media
fdisk is seemingly not installed on this system because the command wasn't available..

What's /dev/shm by the way?

Thanks for the help everyone! I'll manage the whole thing soon :-)

-A
 
Old 09-30-2005, 11:38 AM   #7
-X-
Member
 
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
fdisk is in /sbin which root can run or if you're setup in visudo, use as a user;
$ /sbin/fdisk -l

/dev/shm if for shared memory and not on your hd.

I know you have 17+g in use on the extended partitions. Anyway you could save that data and redo your partition layout?

As root run fdisk -l maybe you have something that's not mounted.
 
Old 09-30-2005, 12:18 PM   #8
Ahmed
Member
 
Registered: May 2005
Location: München, Germany
Distribution: Slackware, Arch
Posts: 386

Original Poster
Rep: Reputation: 41
Code:
Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        1145     9197181   83  Linux
/dev/hda2            1276        7956    53665132+   f  W95 Ext'd (LBA)
/dev/hda3            1146        1275     1044225   82  Linux swap / Solaris
/dev/hda5            1276        2540    10161081    b  W95 FAT32
/dev/hda6            2541        4823    18338166    b  W95 FAT32
/dev/hda7            4824        7564    22017051    b  W95 FAT32
That's the fdisk entry

I won't need any partition rearranging on the extended partition, I have 3 gb of unpartitioned space so I'll create the new swap there and add the rest to another partition.

Thanks a lot!

-A
 
  


Reply



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
moving files from windows partition to linux partition M O L8ingN2dust Linux - Newbie 11 01-08-2006 09:11 PM
Moving swap and sharing folders in distros jazzyjazz Slackware 1 11-19-2003 06:40 AM
Newbie Installing Debian3 on m68k w/250M Partition Needs help creating swap partition AppleMac Linux - Newbie 2 11-01-2002 08:45 AM
Moving swap to another small IDE drive vdi_nenna Linux - Hardware 3 06-14-2002 10:35 AM
Moving swap back to main memory acid_kewpie Linux - General 4 08-26-2001 09:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:30 PM.

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