Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello I am new to volume management and have been watching a few lvm tutorials on youtube, I am trying to create a snapshot of my root volume but get insufficient free space error. I want to make this snapshot incase I goof something up, since this is a fresh install of mint 17 with my drivers and all updates. This is the sequence of commands recorded from my terminal session:
Code:
Script started on Sat 19 Jul 2014 05:49:04 PM EDT
[01;31myte[01;34m log #[00m pvs
PV VG Fmt Attr PSize PFree
/dev/sda5 mint-vg lvm2 a-- 931.27g 44.00m
[01;31myte[01;34m log #[00m vgs
VG #PV #LV #SN Attr VSize VFree
mint-vg 1 2 0 wz--n- 931.27g 44.00m
[01;31myte[01;34m log #[00m lvs
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
root mint-vg -wi-ao--- 927.23g
swap_1 mint-vg -wi-ao--- 4.00g
[01;31myte[01;34m log #[00m moun t
No command 'moun' found, did you mean:
Command 'moin' from package 'python-moinmoin' (main)
Command 'mount' from package 'mount' (main)
Command 'muon' from package 'muon' (universe)
Command 'mon' from package 'mon' (universe)
moun: command not found
[01;31myte[01;34m log #[00m mount
/dev/mapper/mint--vg-root on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
/dev/sda1 on /boot type ext2 (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=bb)
/dev/sdf1 on /media/bb/My Passport type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)
[01;31myte[01;34m log #[00m lvcreate -L150M -s -n backup /dev/mint-vg/root
Rounding up size to full physical extent 152.00 MiB
Volume group "mint-vg" has insufficient free space (11 extents): 38 required.
[01;31myte[01;34m log #[00m lvs
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
root mint-vg -wi-ao--- 927.23g
swap_1 mint-vg -wi-ao--- 4.00g
[01;31myte[01;34m log #[00m exit
exit
Script done on Sat 19 Jul 2014 06:14:29 PM EDT
Can someone point me in the right direction. Also I dont yet know how to avoid the prompt codes from showing up in the log that i recoreded with script -a lvmsession.txt
You let the installer allocate all of the available space, and now there is nothing left (well, 44MB, but that's not much on a 1TB disk) for a new LV. If you don't have too much time invested in the original install+drivers+updates, it might be best just to reinstall and set a more reasonable size (100GB perhaps?) for that filesystem. Then you will have plenty of space available to play with LVM. You can use the df command to see how much space you are actually using on the filesystem now.
If you don't want to reinstall, you will have to reduce the size of that root filesystem and LV. You can't reduce the size of a filesystem while it is mounted, so you will have to boot from the install medium or a rescue disk. The command to resize the LV and filesystem together is
Code:
lvresize --size 100G --resizefs /dev/mint-vg/root
Select whatever size you want there. Do not leave out the "--resizefs" option or the operation will just chop off the end of the filesystem and leave you with the broken remainder. (It's recoverable, but you don't want to go there.) You should be sure that
Code:
fsck -f /dev/mint-vg/root
is run afterward to make sure that all is still well in the filesystem.
Normally I would advise making a full backup before resizing a filesystem, but since this is a fresh install the effort to do that would be similar to just reinstalling if something goes wrong.
Well the output from LVS and VGS command shows that you have got root lv and swap on the system with 927 G and 4 G. The free space from VGS shows only 44 MB of free space in the VG group and that is the reason it is complaining of not enough free space for creating LVM snapshot.
As you said that you want to use LVM snapshot incase you goof up something on the system, here I would like to mention that LVM snapshot is not backup solution. Usually system administrators use LV snapshot for easy recovery, they take LV snapshot before going ahead with some task that will make modification on the file system. So if this is the system wherein your will be playing around with for testing purpose then I would suggest once in a month backup to external drive.
Also as you have got a single LV which is pretty big so am not sure how feasible LV snapshots will be in that case. Though LV snapshot does not take disk space into consideration rather it takes used disk space into consideration.
Quote:
Also I dont yet know how to avoid the prompt codes from showing up in the log that i recoreded with script -a lvmsession.txt
What you mean by prompt codes here? Because script will log everything which is happening on the screen where it has been executed.
Thank you both, as I now understand my root volume is very large and would idealy need to be resized, and given what was said about snapshots not being a backup solution I decided that I was in way over my head with LVM and reinstalled with the default partitioning without checking off LVM. This way I can maybe use a dd to copy my root partition and just wory about learning linux. I sometimes give myself difficult tasks, considering I started using Linux as a complete replacement for Windows about 1 month ago and never looked back, I am much of a linux noob and now it seems this LVM is maybe used by sysadmins for testing big changes before commiting. Thank you both for your help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.