You are not logged in.

#1 2013-02-23 11:51:21

TheFlyingFrenchman
Member
Registered: 2013-02-23
Posts: 9

[SOLVED] UUID of swap file in fstab

Hi everyone,

I am new to Archlinux, and after trying many distros it seems to be the exact flavor I was looking for.

This is much more of a curiosity than an issue.

I installed Arch on a laptop so I need swap to enable the suspend to disk feature. I created a swap file according to the (excellent) wiki.
I noticed that if I put the UUID issued by mkswap in fstab unstead of /swapfile (which, I admit, is not what the wiki says) the system wont startup.
So I tried the method given here. But:

# mkswap -U random /swapfile

fails.
It is also noticeable that lsblk -f does not see the swap file once created (and I guess it may be linked to the fact that system startup fails?).
Putting /swapfile in fstab (as the wiki says) works fine, but we poor sinners are told here that we shall use UUIDs in fstab. In this case I think the confusion between file systems not loaded in the same order and therefore changing name in /dev is not an issue as the swap filename is unique.
So my question is: what is the UUID returned by mkswap for? is it useful in some way?

Last edited by TheFlyingFrenchman (2013-02-24 13:54:13)

Offline

#2 2013-02-23 12:09:13

foutrelis
Developer/TU
From: Athens, Greece
Registered: 2008-07-28
Posts: 675
Website

Re: [SOLVED] UUID of swap file in fstab

Using UUID or LABEL in fstab will only work for partitions; I don't see how it could work for a file.

mkswap treats the swap file the same way as if it were a partition. You can't, however, use its UUID in any meaningful way.

UUIDs and LABELs are useful because the kernel assigns driver letters in a non-predictable way. The problem they solve doesn't exist with files formatted as swap or some other filesystem; you can refer to these by path.

Offline

#3 2013-02-23 13:23:39

TheFlyingFrenchman
Member
Registered: 2013-02-23
Posts: 9

Re: [SOLVED] UUID of swap file in fstab

Ok that was my impression somehow, but I hadn't found it explicitly in any of the wiki or man pages.
I am sure now.
Thank's for the quick and precise answer.

Offline

#4 2013-02-23 23:20:30

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,661

Re: [SOLVED] UUID of swap file in fstab

Please mark your thread [solved] by editing your original post and tagging the subject line. Thanks!


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#5 2013-02-24 13:52:51

TheFlyingFrenchman
Member
Registered: 2013-02-23
Posts: 9

Re: [SOLVED] UUID of swap file in fstab

Doing it right now.
Sorry!

Offline

Board footer

Powered by FluxBB