LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 07-19-2014, 06:27 PM   #1
backwardsbyte
LQ Newbie
 
Registered: Jul 2014
Location: at my computer desk
Distribution: Mint 17 64bit
Posts: 4

Rep: Reputation: Disabled
LVM cannot create snapshot, insufficent space


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
yte log # pvs
  PV         VG      Fmt  Attr PSize   PFree 
  /dev/sda5  mint-vg lvm2 a--  931.27g 44.00m
yte log # vgs
  VG      #PV #LV #SN Attr   VSize   VFree 
  mint-vg   1   2   0 wz--n- 931.27g 44.00m
yte log # 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                                           
yte log # 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
yte log # 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)
yte log # 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.
yte log # 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                                           
yte log # 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
 
Old 07-20-2014, 10:28 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,116

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
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.
 
Old 07-20-2014, 10:31 AM   #3
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
@ Reply

Hi backwardsbyte,

Welcome to LQ!!!

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.
 
Old 07-20-2014, 08:13 PM   #4
backwardsbyte
LQ Newbie
 
Registered: Jul 2014
Location: at my computer desk
Distribution: Mint 17 64bit
Posts: 4

Original Poster
Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] what is a LVM snapshot? aceone Red Hat 6 05-22-2010 01:08 PM
LVM Snapshot eldo Linux - Server 2 11-20-2009 05:10 AM
lvm snapshot using script Ammad Linux - General 2 11-15-2009 09:35 AM
lvm snapshot Ammad Linux - General 1 02-18-2009 08:03 AM
About LVM Snapshot geethusari LinuxQuestions.org Member Intro 1 12-03-2007 08:11 AM


All times are GMT -5. The time now is 05:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration