SliTaz SliTaz Forum

You are not logged in.

#1 2015-12-02 19:24:21

emninger
Member
Registered: 2015-10-24
Posts: 53

Activate swap on boot?

I've a Slitaz installation on an old HP Pavilion (AMD Turion) with an internal ata flash disk formatted like this:

   Device Boot      Start         End      Blocks  Id System

/dev/sda1   *           1       14882   119537664  83 Linux

/dev/sda2           14882       15404     4193280  82 Linux swap

Partition 2 does not end on cylinder boundary

The swap partition is also in /etc/fstab

But, according to what says conky (with the default Slitaz conky config file) swap is disabled.

I looked for grub.conf to configure the swap partition in grub, but i didn't find it. grub is the bootloader i know less (more yaboot and lilo wink ), but i remember from debian, there was a grub.conf file in /etc.

Offline

#2 2015-12-02 19:50:16

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Activate swap on boot?

The definitive command to know if swap is on is:

[c]free[/c]

Swap should be on if it is in fstab. Browse the system messages to look for related errors:

[c]dmesg|less[/c]

(In "less", hit "/" to begin a search, type the word to search for, then "Enter". Then "n" to search again.)

Are you sure your swap partition is swap-formatted? The FS ID in the partition table is not enough to be sure. It doesn't hurt to reformat it:

[c]mkswap /dev/sda2[/c]

as root, but PLEASE BE 100% SURE /dev/sda2 IS THE CORRECT DEVICE NUMBER!

P.-S. : use HTML tags, between <> not [].

Offline

#3 2015-12-02 23:47:49

emninger
Member
Registered: 2015-10-24
Posts: 53

Re: Activate swap on boot?

Thanks for answering. free says:

             total         used         free       shared      buffers

Mem:       2071908      1309340       762568            0        87768

-/+ buffers:            1221572       850336

Swap:      4193276            0      4193276

Yes i'm sure it's swap formatted. cfdisk says:

    sda1        Boot        Primäre   ext4                            122406,57*

    sda2                    Primäre   swap                              4293,92*

In dmesg|less i did not find anything related to swap.

My fstab looks like this:

# /etc/fstab: Information about static filesystems.

#

proc          /proc        proc     defaults             0       0

sysfs         /sys         sysfs    defaults             0       0

devpts        /dev/pts     devpts   rw,gid=5,mode=0620   0       0

tmpfs         /dev/shm     tmpfs    defaults             0       0

tmpfs         /var/lock    tmpfs    defaults             0       0

/dev/cdrom    /media/cdrom iso9660  user,ro,noauto       0       0

#/dev/sda3     /home        ext3     defaults             0       2

#/dev/hdb1     /mnt/data    btrfs    defaults             0       2

#datasvr:/nfs/home  /home   nfs      tcp,nolock           0       0

/dev/sda2    swap    swap    defaults    0 0

Just out of curiousity: Why sda1 is not there? Btw, i did not touch fstab; it's those formed during the installation of Slitaz i presume-

Offline

#4 2015-12-03 07:45:39

yves04
Member
Registered: 2012-09-23
Posts: 135

Re: Activate swap on boot?

As yours my fstab doesn't show /dev/sda1

Just type $mount and you'll see something like

/dev/sda1 on / type ext3 (rw,relatime,errors=continue,user_xattr,barrier=1,data=ordered)

Have a nice day

Offline

#5 2015-12-03 11:14:36

emninger
Member
Registered: 2015-10-24
Posts: 53

Re: Activate swap on boot?

I tried $mount as user and as root, but nothing shows up ... ???

Offline

#6 2015-12-03 11:53:49

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Activate swap on boot?

Swap: 4193276 0 4193276

Congratulations, you have swap!

I tried $mount as user and as root, but nothing shows up

"$" represents the prompt of a normal user in a terminal (# is the prompt for root).

So the command is "mount". Native commands never contain special characters (only letters, digits, -, _, and exceptionally +).

If you're going to use SliTaz regularly, buy yourself a book on Linux, it will prove very useful!

Offline

#7 2015-12-03 11:55:12

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Activate swap on boot?

Also, never type as root a command you don't know, if you've not been told to do so. This is dangerous!

Offline

#8 2015-12-03 13:29:03

Ceel
Administrator
Registered: 2011-04-02
Posts: 1,424

Re: Activate swap on boot?

@emninger

Not familiar at all with fstab file but maybe you don't see sda1 in it because it's the root

Offline

#9 2015-12-03 14:41:29

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Activate swap on boot?

fstab is not required to mount a device. Basically it is a list of "known" filesystems, describing their type, parameters, etc. and assigning a mount point to each. This allows to type e.g. [c]mount /home[/c] and mount will take the missing info from fstab (the regular syntax to call mount is [c]mount -o options -t type /device /mountpoint[/c]).

Offline

#10 2015-12-03 20:56:22

emninger
Member
Registered: 2015-10-24
Posts: 53

Re: Activate swap on boot?

Thanks ilev! A good lesson smile Actually i'm on another machine. Will try later on.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 7 queries executed - Memory usage: 1.55 MiB (Peak: 1.77 MiB) ]