I have just created an OS 11.1/KDE 4.1 installation on a newly assembled self-build computer. Just to test things out I used an old, small, slow disk at /dev/sbd, where I placed the SWAP partition. I would now like to replace this with a newer, larger, faster disk.
My concern is that if I just replace the hardware, Linux will have a fit on the next book because it won’t be able to find the SWAP partition. What’s a safe way to make the change?
if both old and new disk have the same partition layout, eg both only have one partition and it’s swap so they’ll both be /dev/sdb1, then you have nothing to do. If the swap on the new disk is on different partiton, say /dev/sdb2 or /dev/sdb3, adjust fstab accordingly
Delete swap in /etc/fstab. Shutdown your PC, remove the disk, add the new disk, start the system and add swap disk from within YaST:)
I guess you wouldn’t have any problems even without adjusting the fstab since the system would start anyway (correct me someone if i’m wrong since i haven’t used swap for years).
The system will start even if the registered swap partition is missing. When the system is up and running, partition your new hd with the new swap and replace with this your old one in fstab
The new disk I plan to use will be taken from a Windows machine and will contain partitions created under Win XP. It will certainly not contain a partition called SWAP.
Will Linux ask if I want to re-partition the drive? Will it present the same arrangement of 3 partitions (a /usr, a /? ((I forgot and don’t know how to check)) and a /SWAP) as it did when I installed Linux on the the system originally? In the original installation both drives were ex-Windows; Linux presented me with the option to delete all partitions on selected drives and start from a ‘clean’ base.
that’s easy for you to say! What’s fstab? Where is it? Is there a GUI tool for taking things out of it and putting things into it? How can I put a partition into fstab? Or do you mean put the definition of a partition into stab? What does such a definition look like? What does it contain and in what format? Is the data binary or text coded in some way? If it’s binary how do I capture it? If it’s coded text, what encoding is used?
It’s just a line and it is a simple text file writable by root. It’s placed in /etc/ (as is most configuration files)
The disk partitioner looks the same as in the installation but you aren’t presented with the proposed partitioning since this is only part of the installation process.
You can edit the /etc/fstab file with nano (good for beginners, or if you feel like suicidal you can try to edit it with vi :P).
There are lots of possibilities. Lack of choice is not something you experience with Linux.
As others have noted, if you have enough RAM, you can safely start the system without any swap and not notice at all.
Afterwards you can use the partitioner to create a swap partition. Or create it by hand from the CLI and edit /etc/fstab. Ask if you need instructions.
If you can’t spare a partition, you can use a swap file in a mounted partition (instead of a dedicated partition) for very little loss of performance. Remember when swap starts getting used, the system is bogging down anyway, and bit of overhead to get to the file blocks isn’t going to matter that much; you shouldn’t get into that situation if possible.
Well this is not a problem. Resize one of your windows partitions to accomodate the swap partition. You can do that using partitionmagic e.g. under windows or you will install gparted under Linux if you feel not comfortably with fdisk. Then you will create in this empty space a partition with the signature “Linux swap”. The volume name is not important.call fdisk -l and annotate the partition number of the newly created partition. It will be something like /dev/sdbx. Now log in as root then edit /etc/fstab.
Look for the the line containing swap as fs and replace the device node with the one you guessed with fdisk