<div dir="ltr"><div><div>Non ho ben capito il concetto di lvm, ovvero, dovrebbe essere la possibilità di aggiungere dischi ad una server nel caso quelli già esistenti risultassero pieni, il tutto senza dover spostare dati ma semplicemente allargando la partizione sul nuovo disco, è corretto? <br><br></div>Scritto sta cosa, che so già sarà di difficile comprensione, la domanda mi sorge spontanea..............se ho uno spazio già allocato, ci copio su dati e poi li cancello, quando andrò a copiare ancora dati su quello spazio, il sistema andrà comunque a sovrascrivere lo spazio che prima era occupato dai dati cancellati, o no?  <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-07-04 12:37 GMT+02:00 Valerio Pachera <span dir="ltr"><<a href="mailto:sirio81@gmail.com" target="_blank">sirio81@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Ecco qua la dimostrazione di quanto scritto sopra.<br></div>Ho fatto un thin-volume da 5G e ci ho scritto 2 file da 512M.<br></div>Poi ho cancellato uno dei file.<br></div>Ho paragonato il <b>mapped size</b> prima e dopo la rimozione e non è variato.<br></div>Ho poi eseguito fstrim e lo spazio si è liberato.<b><br></b><div><div><div><div><br>lvcreate -V5G -T pve/pve-thin -n test<br>  Using default stripesize 64,00 KiB.<br>  Logical volume "test" created.<br>mkfs.ext4 /dev/pve/test<br>mke2fs 1.43.4 (31-Jan-2017)<br>Discarding device blocks: fatto                         <wbr>  <br>Creazione del file system con 1310720 4k blocchi e 327680 inode<br>Etichetta del file system=c24a4410-dabe-4b98-<wbr>bfdf-43777088cd55<br>Backup del superblocco salvati nei blocchi: <br>        32768, 98304, 163840, 229376, 294912, 819200, 884736<br><br>Allocating group tables: fatto                         <wbr>  <br>Scrittura delle tavole degli inode: fatto                         <wbr>  <br>Creating journal (16384 blocks): fatto<br>Scrittura delle informazioni dei super-blocchi e dell'accounting del file system: fatto<br><br>mkdir /mnt/test <br>mount /dev/pve/test /mnt/test<br>dd if=/dev/urandom of=/mnt/test/garbage1 bs=1M count=512<br>dd if=/dev/urandom of=/mnt/test/garbage2 bs=1M count=512<br><br>lvdisplay /dev/pve/test<br>  --- Logical volume ---<br>  LV Path                /dev/pve/test<br>  LV Name                test<br>  VG Name                pve<br>  LV UUID                HDvbtK-pQjQ-Izqw-KevC-obNE-<wbr>100W-lU0D0e<br>  LV Write Access        read/write<br>  LV Creation host, time vmserver, 2017-07-04 12:26:12 +0200<br>  LV Pool name           pve-thin<br>  LV Status              available<br>  # open                 1<br>  LV Size                5,00 GiB<br>  Mapped size            22,89%<br>  Current LE             1280<br>  Segments               1<br>  Allocation             inherit<br>  Read ahead sectors     auto<br>  - currently set to     256<br>  Block device           253:9<br><br><br>rm /mnt/test/garbage2 <br><br>lvdisplay /dev/pve/test<br>  --- Logical volume ---<br>  LV Path                /dev/pve/test<br>  LV Name                test<br>  VG Name                pve<br>  LV UUID                HDvbtK-pQjQ-Izqw-KevC-obNE-<wbr>100W-lU0D0e<br>  LV Write Access        read/write<br>  LV Creation host, time vmserver, 2017-07-04 12:26:12 +0200<br>  LV Pool name           pve-thin<br>  LV Status              available<br>  # open                 1<br>  LV Size                5,00 GiB<br><b>  Mapped size            22,89%</b><br>  Current LE             1280<br>  Segments               1<br>  Allocation             inherit<br>  Read ahead sectors     auto<br>  - currently set to     256<br>  Block device           253:9<br><br><br>fstrim /mnt/test<br><br>lvdisplay /dev/pve/test <br>  --- Logical volume ---<br>  LV Path                /dev/pve/test<br>  LV Name                test<br>  VG Name                pve<br>  LV UUID                HDvbtK-pQjQ-Izqw-KevC-obNE-<wbr>100W-lU0D0e<br>  LV Write Access        read/write<br>  LV Creation host, time vmserver, 2017-07-04 12:26:12 +0200<br>  LV Pool name           pve-thin<br>  LV Status              available<br>  # open                 1<br>  LV Size                5,00 GiB<br><b>  Mapped size            12,89%</b><br>  Current LE             1280<br>  Segments               1<br>  Allocation             inherit<br>  Read ahead sectors     auto<br>  - currently set to     256<br>  Block device           253:9<br><br><br></div></div></div></div></div>
<br><br>
--<br>
Mailing list info: <a href="https://lists.linux.it/listinfo/ll" rel="noreferrer" target="_blank">https://lists.linux.it/<wbr>listinfo/ll</a><br>
<br></blockquote></div><br></div>