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