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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
09-30-2005, 10:04 AM
|
#1
|
|
Member
Registered: May 2005
Location: München, Germany
Distribution: Slackware
Posts: 386
Rep:
|
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.
|
|
|
|
09-30-2005, 10:18 AM
|
#2
|
|
Member
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495
Rep:
|
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.
|
|
|
|
09-30-2005, 10:20 AM
|
#3
|
|
Senior Member
Registered: Dec 2004
Location: Bawstun area
Distribution: Suse (10.2, 10.3), CentOS, and Ubuntu
Posts: 1,794
Rep:
|
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.
|
|
|
|
09-30-2005, 10:28 AM
|
#4
|
|
Member
Registered: May 2005
Location: München, Germany
Distribution: Slackware
Posts: 386
Original Poster
Rep:
|
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.
|
|
|
|
09-30-2005, 10:35 AM
|
#5
|
|
Member
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495
Rep:
|
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?
|
|
|
|
09-30-2005, 11:25 AM
|
#6
|
|
Member
Registered: May 2005
Location: München, Germany
Distribution: Slackware
Posts: 386
Original Poster
Rep:
|
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
|
|
|
|
09-30-2005, 11:38 AM
|
#7
|
|
Member
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495
Rep:
|
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.
|
|
|
|
09-30-2005, 12:18 PM
|
#8
|
|
Member
Registered: May 2005
Location: München, Germany
Distribution: Slackware
Posts: 386
Original Poster
Rep:
|
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
|
|
|
|
| Thread Tools |
Search 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
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:03 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|