Scratch
Posts: 13
Joined: Sun Oct 07, 2012 2:40 am

disabling swap

Sun Oct 07, 2012 2:45 am

I know this may not be the best idea, but trying to run the standard install without a swap partition leads to a kernel panic on the first boot b/c it tries to mount the root fs on partition 3 which doesn't exist...

any workaround?

thanks in advance.

User avatar
Sander
Posts: 174
Joined: Wed Aug 31, 2011 1:01 pm

Re: disabling swap

Sun Oct 07, 2012 7:54 am

I don't understand why you don't want to have swap, but anyway:

The swap setting is in /etc/fstab. So you could try to uncomment the line saying ".... swap ... " by putting a "#" at the beginning of the line.
If you can't a prompt to edit /etc/fstab, you can put your SD card into another computer, mount it, find /etc/fstab and edit it.

HTH

Heater
Posts: 15949
Joined: Tue Jul 17, 2012 3:02 pm

Re: disabling swap

Sun Oct 07, 2012 1:51 pm

Traditionally developers of embedded systems using Linux and file systems on large FLASH devices have disabled swap and logging and anything else that regulary writes to the files system. The reason being that those FLASH devices wear out after a limited number of writes. If you have an embedded system operating for years and years you really don't want that to happen.

I belive the same is still true with the FLASH memory in SD cards. The number of writes in their life time may be a lot higher now but a limit is still there.

Besides if you getting into swap usage all of a sudden everything gets really slow. Swap migh be good to ensure the machine does not actually crash or kill processes when you run out of RAM but it's not much fun to use in that condition.

All in all , why do we want swap on a Raspi?
Memory in C++ is a leaky abstraction .

Scratch
Posts: 13
Joined: Sun Oct 07, 2012 2:40 am

Re: disabling swap

Sun Oct 07, 2012 2:40 pm

Sander wrote: If you can't a prompt to edit /etc/fstab, you can put your SD card into another computer, mount it, find /etc/fstab and edit it.
Thanks for your replies, I think this is whats going to have to be done.

Thanks again!

Scratch
Posts: 13
Joined: Sun Oct 07, 2012 2:40 am

Re: disabling swap

Sun Oct 07, 2012 5:20 pm

hmmm, my /etc/fstab is as follows...

Code: Select all

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/mmcblk0p2 during installation
UUID=blahblahblah /               ext4    errors=remount-ro 0       1
# /boot was on /dev/mmcblk0p1 during installation
UUID=blahblahblah  /boot        vfat    utf8            0       0
It shows the correct partitions I think? any other ideas?

The error I'm getting on boot is:
PANIC: VFS: Unable to mount root fs on unknown-block(179,3)

Entering kdb (current=0xcd82ac80, pid1) due to Keyboard Entry
kdb> _

User avatar
Sander
Posts: 174
Joined: Wed Aug 31, 2011 1:01 pm

Re: disabling swap

Sun Oct 07, 2012 7:04 pm

That doesn't look like a swap problem to me.

So did you Google "PANIC: VFS: Unable to mount root fs on unknown-block" ?

Scratch
Posts: 13
Joined: Sun Oct 07, 2012 2:40 am

Re: disabling swap

Sun Oct 07, 2012 7:51 pm

Sander wrote:So did you Google "PANIC: VFS: Unable to mount root fs on unknown-block" ?
Yes, Google came up with this thread: http://www.raspberrypi.org/phpBB3/viewt ... 8&p=188927 which seemed to suggest an SD card problem, however I have installed other OSs on the same card with success.

The second post in that thread seemed to suggest a possible swap problem that seemed to fit with my limited understanding of the error message i received. the problem seemed unresolved.

Scratch
Posts: 13
Joined: Sun Oct 07, 2012 2:40 am

Re: disabling swap

Sun Oct 07, 2012 10:31 pm

Well installing it in exactly the same manner except with the default partitions (including 256MB of swap space and / mounted on partition 3) it worked, so I'm fairly confident it has something to do with / being mounted to the 3rd partition that doesn't exist any more.

There must be a setting somewhere to be changed?

plugwash
Forum Moderator
Forum Moderator
Posts: 3614
Joined: Wed Dec 28, 2011 11:45 pm

Re: disabling swap

Sun Oct 07, 2012 10:42 pm

IIRC the kernel command line (including the location of the root partition) is set by cmdline.txt on the fat parition.

Scratch
Posts: 13
Joined: Sun Oct 07, 2012 2:40 am

Re: disabling swap

Sun Oct 07, 2012 11:10 pm

plugwash wrote:IIRC the kernel command line (including the location of the root partition) is set by cmdline.txt on the fat parition.
thanks, I have a strong feeling this will work to solve my problem

Scratch
Posts: 13
Joined: Sun Oct 07, 2012 2:40 am

Re: disabling swap

Mon Oct 08, 2012 12:37 am

I cant edit posts for some reason... but this worked, thanks all!

Return to “Raspberry Pi OS”