Autodetecting swap space

Working with embedded systems brings a whole world to you and it might be that you have to adapt certain things to your current environment which might not be avaliable all the time like special devices or discs. In my case it was an optional card for a swap partition. How do you recognize it?

I assume that the swap discs were marked with fdisk to be type 82 discs (swap). For finding and using such a partition you could use the following method. $DISK is the device you want to scan:

swapon `fdisk -l $DISK | grep swap | cut -c 1-9`

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *