Use LVM to limit shared folder size
If you’d like to set aside a maximum amount of space for your shared folder, and you’ve enabled Logical Volume Manager on your Ubuntu install [ seeTutorials,p72, LXF202], then you can use LVM to set up a dedicated partition as a shared volume. If you want to avoid using the Terminal, boot from your Ubuntu install disc, then search the SoftwareCenter for ‘lvm’. Select ‘Logical Volume Management’ and click More info > Use This Source > Install. Once done, launch Logical Volume Management from Launcher, expand Logical View, select root and click ‘Edit Properties’. Reduce the size of your main partition by the amount you wish to allocate to the shared volume – say 2GB.
Now reboot into your main Ubuntu installation. Open Terminal and type sudo
mkdir /mnt/<shared> , changing <shared> to your choice of shared folder name. If you’ve not previously used the LVM graphical tool, install it again from the SoftwareCenter. Launch it, select Logical View in the left-hand pane and click ‘Create New Logical Volume’ to set up your new shared volume. Give it a suitable name (say
shared), then click ‘Use remaining’ to allocate it all the space you freed up in the previous step. Select ‘Ext4’ for filesystem, then tick both ‘Mount’ and ‘Mount when rebooted’ boxes. Type
/samba/<shared> into the Mount point box, replacing <shared> with the folder name you created in step two. Click ‘OK’ and the volume will be created and mounted, ready for sharing – either via file manager or using gadmin-samba if your needs are more complex.