Disable swap and mount disks readonly - how? (Solved)

Booting, installing, newbie
Post Reply
Message
Author
geep
Posts: 2
Joined: Tue 25 Dec 2012, 19:21

Disable swap and mount disks readonly - how? (Solved)

#1 Post by geep »

Hi,
1/ I'm using Slacko Puppy v5.4 to retrieve files from a dying PC. Booting off a DVD and saving stuff to a USB stick.

The dying PC has a couple of disks with Linux swap files, and I can see that Puppy is using one of these swapfiles.

I don't want to write anything at all to the hard disks as the PC is very sick. Want to tell Puppy at boot to not use the swap partitions at all.
Also can't see how to mount hard disks readonly.

Any help appreciated.

2/ I have found Slacko amazing - have installed several Slackware binary packages direct from Slackware (perl, python, gcc-gfortran etc.) and also compiled from slackbuilds.org. But haven't found any clear instructions on how to create .sfs archives. Some of the things I've compiled - e.g. R and gdal - I'd like to package as .sfs.

Any pointers to a good .sfs tutorial?

Cheers,
Peter

Atle
Posts: 596
Joined: Wed 19 Nov 2008, 12:38
Location: Oslo, Norway
Contact:

#2 Post by Atle »

Aint got no pointer to SFS tutorial, but you can at least use Gparted to delete the swap drive...

Menu
System
Gparted

Remember to pick the right drive and not your USB mem stick.

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#3 Post by rhadon »

Type man mount in a console. Under Options you'll find the option -r.
E.g. if you want to mount sdb1 read only:

Code: Select all

mount -r /dev/sdb1 /mnt/sdb1
If /mnt/sdb1 doesn't exist, you have to create this folder manually.


About swap you can type swapoff or swapon and you'll get a list of options.

swapoff -a should work.

Also from gparted it should be possible to switch on or off without deleting.

Cheers,
Rolf

Edit: For building a sfs you can use the commands dir2sfs or mksquashfs. Or maybe Pet_Maker-2.0.pet, you can find here, but I haven't tested.
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

geep
Posts: 2
Joined: Tue 25 Dec 2012, 19:21

Disable swap & mount disk RO:how? Post SlackBuild sfs recipe

#4 Post by geep »

1/ Cheers guys. Am now happily switching swap on and off.

2/ And I found elsewhere all about .sfs files.
Found it was pretty simple to use a standard .SlackBuild script to compile a Slackware package, and with 4 additional lines of bash script was able to create an .sfs package.

In case anybody is interested, this is my trivial recipe used to build the .sfs after building gdal as downloaded from http://slackbuilds.org/repository/14.0/libraries/gdal/

Code: Select all

cd /tmp/SBo/package-gdal
sh install/doinst.sh

mksquashfs /tmp/SBo/package-gdal /tmp/gdal-1.9.1-i486-1_SBo.zip.sfs -e /tmp/SBo/package-gdal/install 
mksquashfs /tmp/SBo/package-gdal /tmp/gdal-1.9.1-i486-1_SBo.xz.sfs -comp xz -Xbcj x86 -e /tmp/SBo/package-gdal/install 
Similar recipe should work for any well-behaved .SlackBuild script. It could probably be generalized using the environment variables from the .SlackBuild script.
It's probably worth looking at the autogenerated (by makepkg) doinst.sh just to check it's sensible.

(Note to anybody copying this slavishly without engaging brain - gdal needs both geos and proj - I had already installed these.)

I built both zip and xz compressed .sfs to compare the sizes. They are both bigger than the Slackware .txz package.

-rwxr-xr-x 1 root root 5.5M Jan 1 14:26 gdal-1.9.1-i486-1_SBo.xz.sfs
-rwxr-xr-x 1 root root 7.0M Jan 1 14:26 gdal-1.9.1-i486-1_SBo.zip.sfs
-rw-r--r-- 1 root root 4.5M Dec 22 22:30 gdal-1.9.1-i486-1_SBo.txz

I came to the conclusion that there's little point in building an .sfs for something as small as gdal. Seems better to build and install the Slackware .txz. But there could be some mileage in building a package containing the prerequisites too - gdal, geos and proj all together. Or maybe for something big like vlc, especially if you build it with all (or most) of its dependencies statically linked.

Cheers,
Peter

Post Reply