Can't automount swap

15 respostas [Última entrada]
ssorbom
Desconectado
Joined: 10/30/2011

Hi guys (and gals?),
I have so many questions I hardly know where to begin. I guess I will start with just one at a time.
Firstly, let me say that I have been using Trisquel for about 5 months and have been fairly happy with it.
I have one problem though:
I have a computer that has trisquel on it and things worked on it OK at first. I had set aside a gig of swap for trisquel to use, but when I installed a bare bones debian install for experimentation with some software provided in debian's repositories. One of the things that happened was that Debian reformatted the swap partition I had. As far as I can tell, the swap partition still has the same label as when I first installed Trisquel, but Trisquel no longer auto-mounts the partition in question. As a result, I can no longer hibernate the machine (which I used to do somewhat often). What should I do? Here is my fstab
file:

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' 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).
#
#
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda5 during installation
UUID=f0158a58-bf5e-41c4-ad66-9c2d4a255d59 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=17f5ea24-1be7-4e70-8cb8-3a6a27e194e6 auto swap sw 0 0

ssorbom
Desconectado
Joined: 10/30/2011

Oops, forgive my errors, I just noticed that I forgot to finish a sentence. Anyway, trouble started when I tried to install Debian

sphynx
Desconectado
Joined: 11/30/2011

If the partition was reformatted, I guess it's UUID changed. Do:

$ ls -lF /dev/disk/by-uuid/

and find the new UUID, then replace the old one with it in your /etc/fstab.

Or you could replace "UUID=..." in your /etc/fstab with "LABEL=swap", if
"swap" is the label.

lembas
Desconectado
Joined: 05/13/2010

Also, most of the things in Debian repos will work on Trisquel. Just steer
clear of any non-free bits.

mYself
Desconectado
Joined: 01/18/2012

You should replace all UUIDs with proper path to devices, eg. /dev/sda1 (use
'Disk Utility' to find yours) to prevent these situations. Do not forget to
make a backup before you change something.

mYself
Desconectado
Joined: 01/18/2012

I had a similar problem in the past when I upgraded from Trisquel 4.5 to 5.0
and the system did not wanted to boot up. That was caused because the device
names was changed in the new release from
'/dev/mapper/isw_cbghfjicjf_Volume0p#' to '/dev/dm-#'.

Magic Banana

I am a member!

I am a translator!

Desconectado
Joined: 07/24/2010

First of all, notice that a swap partition is not "mounted" (as a
consequence, it is not listed by the 'mount' command). It is only "enabled"
(thanks to the 'swapon' command launched during the 'init' after reading
/etc/fstab).

Anyway, if you do not want to bother with UUIDs, you can simply use the path to the partition. The line in /etc/fstab would then be something like that
(just replace the partition number if required):
/dev/sda6 none swap sw 0 0

ssorbom
Desconectado
Joined: 10/30/2011

Thank you for your responses,
Sphynx, I tried your solution yesterday and there was slight progress.
Trisquel evidently saw it, but I must have entered the wrong UUID because it
threw a "partition not ready" error. If I told the system to continue anyway,
Trisquel would boot normally and I could enable the swap partition manually
with the Swapon command. Thank god I have an extra copy of fstab!
Magic Bannana and mYself,
Noted, I shall try the fstab modification when I am able.
Lembas,
It was a slight concern I had, but I figured it being Debian I was fairly
safe as long as I stayed away from non-free repos.

ssorbom
Desconectado
Joined: 10/30/2011

Ok,
Replacing the UUID with the partition designation "/dev/sda6 none swap sw 0
0" worked, and swap now automounts correctly at boot. However, it cant seem
to recover hibernated sessions anymore. I tried setting the partition boot
flag to bootable through the disk manager utility, and I also tried changing
the "none" flag in fstab to auto. Neither of these methods seem to work. I
should note that the computer itself boots fine, it is just as though I was
booting from a standard powerup instead of a hibernated session. Are there
additional settings I have to change to make this work?

sphynx
Desconectado
Joined: 11/30/2011

If the partition was reformatted, I guess it's UUID changed. Do:

$ ls -lF /dev/disk/by-uuid/

and find the new UUID, then replace the old one with it in your /etc/fstab.

Or you could replace "UUID=..." in your /etc/fstab with "LABEL=swap", if "swap" is the label.

lembas
Desconectado
Joined: 05/13/2010

nevermind

mYself
Desconectado
Joined: 01/18/2012

You should replace all UUIDs with proper path to devices, eg. /dev/sda1 (use 'Disk Utility' to find yours) to prevent these situations. Do not forget to make a backup before you change something.

mYself
Desconectado
Joined: 01/18/2012

I had a similar issue in the past when I upgraded from Trisquel 4.5 to 5.0 and the system did not wanted to boot up. That was caused because the device names was changed in the new release from '/dev/mapper/isw_cbghfjicjf_Volume0p#' to '/dev/dm-#' (in fstab).

Magic Banana

I am a member!

I am a translator!

Desconectado
Joined: 07/24/2010

First of all, notice that a swap partition is not "mounted" (as a consequence, it is not listed by the 'mount' command). It is only "enabled" (thanks to the swapon command launched during the 'init' after reading /etc/fstab).

Anyway, if you do not want to bother with UUIDs, you can simply use the path to the partition. The line in /etc/fstab would then be something like that (just replace the partition number if required):
/dev/sda6 none swap sw 0 0

ssorbom
Desconectado
Joined: 10/30/2011

Thank you for your responses,
Sphynx, I tried your solution yesterday and there was slight progress. Trisquel evidently saw it, but I must have entered the wrong UUID because it threw a "partition not ready" error. If I told the system to continue anyway, Trisquel would boot normally and I could enable the swap partition manually with the Swapon command. Thank god I have an extra copy of fstab!
Magic Bannana and mYself,
Noted, I shall try the fstab modification when I am able.
Lembas,
It was a slight concern I had, but I figured it being Debian I was fairly safe as long as I stayed away from non-free repos.

ssorbom
Desconectado
Joined: 10/30/2011

Ok,
Replacing the UUID with the partition designation "/dev/sda6 none swap sw 0 0" worked, and swap now automounts correctly at boot. However, it cant seem to recover hibernated sessions anymore. I tried setting the partition boot flag to bootable through the disk manager utility, and I also tried changing the "none" flag in fstab to auto. Neither of these methods seem to work. I should note that the computer itself boots fine, it is just as though I was booting from a standard powerup instead of a hibernated session. Are there additional settings I have to change to make this work?