managing the swap space size on fedora
Angelo Moreschini
mrangelo.fedora at gmail.com
Sun Jun 14 09:29:54 UTC 2015
Ciao Dario,
I need a little explanation, because I am not able to well understood
about how to get of the value of the free space.
I made some tests:
using the command pvscan I get this output:
-----
PV /dev/sda2 VG fedora_localhost lvm2 [931.02 GiB / 64.00 MiB free]
Total: 1 [931.02 GiB] / in use: 1 [931.02 GiB]* / in no VG: 0 [0 ]*
-----
what means this ?
I can think this output concern ALL the Volume Group of LVM:
And the row up seem to indicate that they are (only) 64 MB free
*(but what means "/ in no VG: 0 [0 ]" in the row down?)*
I made the same test (inside the lvm environment) using the command lvscan:
this time I got this output:
-----
lvm> lvscan
ACTIVE '/dev/fedora_localhost/swap' [7.75 GiB] inherit
ACTIVE '/dev/fedora_localhost/home' [873.21 GiB] inherit
ACTIVE '/dev/fedora_localhost/root' [50.00 GiB] inherit
----- OK! the total is 930.96 ------
that the second control confirm the former one, and it shows also more
details...
But what does not enter in my head, is the fact that the (huge) quantity of
free space (845449680 ) of the "home" partition is not reported when I
used the command pvscan : ...
This is the output of the command line df -k:
-----
[angelo_dev at localhost ~]$ df -k
Filesystem 1K-blocks Used
Available Use% Mounted on
/dev/mapper/fedora_localhost-root 51475068 10518776 38318468 22%
/
devtmpfs 4046300 0
4046300 0% /dev
tmpfs 4057324
152 4057172 1% /dev/shm
tmpfs 4057324 904
4056420 1% /run
tmpfs 4057324
0 4057324 0% /sys/fs/cgroup
tmpfs 4057324 668
4056656 1% /tmp
*/dev/mapper/fedora_localhost-home 901125392 9878132 845449680 2%
/home*
/dev/sda1 487652 105670
352286 24% /boot
tmpfs 811468
28 811440 1% /run/user/1001
-----
*in shor*t: I would like understand because I have to ask (shrink) free space,
in order to expand the swap partition - in the moment that - the home
partition (THAT BELONGS TO THE SAME VG) already has a huge amount of free
space ?
Thank you
Angelo
On Sat, Jun 13, 2015 at 9:28 PM, Dario Lesca <d.lesca at solinos.it> wrote:
> Il giorno sab, 13/06/2015 alle 17.01 +0300, Angelo Moreschini ha
> scritto:
> > Hi,
> > I need to adjust the swap space of my computer, and using the
> > commands lsblk e swapon -s :
> > I got the following output
> > - =-=-=-=-=-=-
> > [angelo_dev at localhost ~]$ sudo lsblk
> > NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
> > sda 8:0 0 931.5G 0 disk
> > ├─sda1 8:1 0 500M 0 part /boot
> > └─sda2 8:2 0 931G 0 part
> > ├─fedora_localhost-swap 253:0 0 7.8G 0 lvm [SWAP]
> > ├─fedora_localhost-root 253:1 0 50G 0 lvm /
> > └─fedora_localhost-home 253:2 0 873.2G 0 lvm /home
> > sr0 11:0 1 1024M 0 rom
> > [angelo_dev at localhost ~]$ swapon -s
> > Filename Type Size Used Priority
> > /dev/dm-0 partition 8126460 0 -1
> > - =-=-=-=-=-=-
> >
> > This makes me think that the swap space on my computer resides on the
> > partition / dev / dm-0, which is 'managed by LVM, and' of about 8 GB.
> > The RAM of the computer and 'GB, and I would initially try to bring
> > the swap space to 16 GB (after I might try other values ....).
> >
> > Since the swap partition and 'managed by LVM should not be hard to
> > change its size, but it is still fairly inexperienced I would get a
> > little help to do this.
>
> Your swap partition is /dev/fedora_localhost-swap
>
> take a look at how much free space you have in LVM
>
> > sudo pvscan
> > PV /dev/mapper/luks-04cb7d3f-fb60-42ca-9dbe-1ae18433f62d VG
> vg_dododell lvm2 [196,28 GiB / 7,72 GiB free]
> > Total: 1 [196,28 GiB] / in use: 1 [196,28 GiB] / in no VG: 0 [0 ]
>
> In my case 7,72 GiB free.
> If you have sufficient free space in LVM you can extend swap partition
> with:
>
> > sudo pvresize --size +6G /dev/fedora_localhost-swap
>
> If you do not have sufficient LVM space free, you can shrink some other
> partition, like /home, you can do that in single user mode, or logging
> in with root from CTRL+Alt+F2 and without other active users, umount
> /home, restrict filesystem (example 11Gb) , restrict partition (example
> 10 Gb), extend filesystem to max partition.
>
> At this point you can extend the swap LVM partition.
>
> When you have extend the swap partition, you must extend the swap area
> with this command:
>
> > swapoff /dev/fedora_localhost-swap
> > mkswap /dev/fedora_localhost-swap
> > swapon /dev/fedora_localhost-swap
>
> Hope this help
>
> Ciao
>
> --
> Dario Lesca
> (inviato dal mio Linux Fedora 22 con Gnome 3.16)
> --
> users mailing list
> users at lists.fedoraproject.org
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> Have a question? Ask away: http://ask.fedoraproject.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/users/attachments/20150614/98d3deb3/attachment-0001.html>
More information about the users
mailing list