LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   swap partition not being mounted at boot (https://www.linuxquestions.org/questions/linux-general-1/swap-partition-not-being-mounted-at-boot-601845/)

lothario 11-23-2007 04:46 AM

swap partition not being mounted at boot
 
I moved my system to a bigger hard disk using Ghost4Linux.
Then I used Gparted to:
1. Move the swap partion to the end of the disk
2. Grow the / partition from 7Gig to 15Gig

Just about everthing is working fine.

The only thing that is not being picked up is the swap partition.
The /etc/fstab file still shows the old LABEL and the disk to be hda.

Code:

# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/1                /                      ext3    defaults        1 1
LABEL=/boot            /boot                  ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs  defaults        0 0
none                    /proc                  proc    defaults        0 0
none                    /sys                    sysfs  defaults        0 0
LABEL=SWAP-hda3        swap                    swap    defaults        0 0
/dev/hda                /media/cdrom            auto    pamconsole,exec,noauto,managed 0 0

The new disk is hdc and hda is a new CDROM drive on this system.
So the new CDROM is being recognized at boot time.
But the old swap partition entry is not being replaced/updated.

If I do "swapon /dev/hdc3" from the command line then the swap partition is enabled and being used.

But if I reboot the system then /dev/hdc3 is not being enabled at boot time.

What should I do?
man fstab-sync says "... This program is usually never run directly from a shell ..."

syg00 11-23-2007 04:51 AM

Simplest would be to do a mkswap on /dev/hdc3 and assign the old label to it - see the manpage.

lothario 11-23-2007 05:23 AM

Thanks syg00

I did:
mkswap -c -L SWAP-hda3 /dev/hdc3

Then I reboot the system.
Now the hdc3 swap partition is being enabled at boot.
This is good.

The hda3 label is going to cause some confusion down the road.
Is there any other way to take care of this?

jschiwal 11-23-2007 05:26 AM

Use a device instead the label in /etc/fstab.

lothario 11-23-2007 05:54 AM

Quote:

Originally Posted by jschiwal (Post 2968300)
Use a device instead the label in /etc/fstab.

Yes, that was the first thing I thought of. Won't that get overwritten by anything using fstab-sync.

syg00 11-23-2007 07:17 AM

Just change the label to SWAP, and update fstab. I think fstab-sync is only for HAL.
Been known to be wrong though ... :p


All times are GMT -5. The time now is 07:38 PM.