LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-23-2008, 12:34 AM   #1
TruongAn
Member
 
Registered: Dec 2004
Location: Vietnam (Việt Nam)
Distribution: Gentoo (desktop), Arch linux (laptop)
Posts: 728

Rep: Reputation: 33
My Fedora box cannot enable swap on itself.


Hi guys.
I have install Fedora 8 for while and everything went fine until I decided to try out Ubuntu 7.10. When I installed ubuntu, I have to create some new partition thus and Fedora start complain about my /etc/fstab file. So I decided it delete /etc/fstab file and re-write it.
Before rewrite it is:
Code:
LABEL=/                 /                       ext3    defaults        1 1
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/sda8               swap                    swap    defaults        0 0

# /dev/sda5
UUID=0bc114b7-5500-493e-8b08-da78a4e3f388 /mnt/ubuntu               ext3    defaults,errors=remount-ro 0       1

# /dev/sda1
UUID=74C7834C38D332C0 /mnt/vista     ntfs    defaults,nls=utf8,umask=007,gid=46 0       1

# /dev/sda7
#UUID=16330797-6313-4328-bd90-4cad5746eecf /media/sda7     ext3    defaults        0       2

#/dev/hda        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/sda9       /mnt/lindata     vfat    rw,user,umask=0000      1       1
/dev/sda2       /mnt/windata     vfat    rw,user,umask=0000      1       1
I delete the swap partition to make space for ubuntu, and the recreate a new swap partition at /dev/sda9. So now, my fstab look like:
Code:
LABEL=/                 /                       ext3    defaults        1 1
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/sda9              swap                    swap    defaults        0 0

# /dev/sda5
/dev/sda5 /mnt/ubuntu               ext3    defaults,errors=remount-ro 0  1

# /dev/sda1
/dev/sda1 /mnt/vista     ntfs    defaults,nls=utf8,umask=007,gid=46 0       1

# /dev/sda7
#/dev/sda7 /media/sda7     ext3    defaults        0       2

#/dev/hda        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/sda8       /mnt/lindata     vfat    rw,user,umask=0000      1       1
/dev/sda2       /mnt/windata     vfat    rw,user,umask=0000      1       1
It boot up file with that fstab. But I cannot enable the swap and cannot run fschk for those ext partition either.
The error message I noticed when it boot up was:
Quote:
Checking file system
WARNING: couldn't open /etc/fstab: Permission denied.
I check the file's permission, it is:
Code:
-bash-3.2$ ls -lh /etc/fstab
-rw-r--r-- 1 root root 932 2007-12-28 23:29 /etc/fstab
The weird things is that, after Fedora load and I get a console, I can run
Code:
swapon -a
To enable the swap partition without anny erros.

Please show me how to fix that. I am tired of typing swapon everytime I start my computer.
 
Old 01-23-2008, 01:54 AM   #2
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
any line with a pound mark in front will not load ok the swap thing is wierd because that is what grub and lilo look for. so open a terminal and sudo cfdisk /dev/sda this will show you all your partitions on the sda disk.
 
Old 01-23-2008, 02:12 AM   #3
v00d00101
Member
 
Registered: Jun 2003
Location: UK
Distribution: Devuan Beowulf
Posts: 514
Blog Entries: 1

Rep: Reputation: 37
Or try:

fdisk -l as root. It lists all partitions on all drives.


Try adding swapon -a to rc.local to automate it.

Also should these highlighted drives, be like this.

Code:
LABEL=/                 /                       ext3    defaults        1 1
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/sda9              swap                    swap    defaults        0 0

# /dev/sda5
/dev/sda5 /mnt/ubuntu               ext3    defaults,errors=remount-ro 0  1

# /dev/sda1
/dev/sda1 /mnt/vista     ntfs    defaults,nls=utf8,umask=007,gid=46 0       1

# /dev/sda7
#/dev/sda7 /media/sda7     ext3    defaults        0       2

#/dev/hda        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/sda8       /mnt/lindata     vfat    rw,user,umask=0000      1       1
/dev/sda2       /mnt/windata     vfat    rw,user,umask=0000      1       1
Or have you swapped the lindata and swap partitions around?
 
Old 01-23-2008, 07:03 PM   #4
TruongAn
Member
 
Registered: Dec 2004
Location: Vietnam (Việt Nam)
Distribution: Gentoo (desktop), Arch linux (laptop)
Posts: 728

Original Poster
Rep: Reputation: 33
I have deleted the swap partition and then recreated. Here is my partition table:
Code:
$ sudo /sbin/fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000876dc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        5099    40957686    7  HPFS/NTFS
/dev/sda2            5100        8924    30723072    c  W95 FAT32 (LBA)
/dev/sda3            8925       19457    84606322+   5  Extended
/dev/sda5            8925       11473    20474811   83  Linux
/dev/sda6           11474       14023    20482843+  83  Linux
/dev/sda7           14024       15718    13615056   83  Linux
/dev/sda8           15998       19457    27791360    b  W95 FAT32
/dev/sda9           15719       15997     2241036   82  Linux swap / Solaris

Partition table entries are not in disk order
I think fedora do try to enable swap but I state that it cannot open /etc/fstab due to permission denied.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
I can't enable swap in FC4 Taimur Fedora 1 06-14-2006 11:44 PM
I can't enable swap in FC4 Taimur Fedora 1 06-14-2006 11:42 PM
not enough memory to run YaST,enable swap space, but can't ArtsWorks Linux - Newbie 8 09-13-2004 08:59 AM
Fedora boot hang (after Enable swap) Redeye2 Fedora 4 09-10-2004 07:22 AM
How do you enable a swap partition? DartMol Linux - Newbie 4 03-28-2003 02:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:03 AM.

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