[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

backing up with rsnapshot and LVM snapshots



Hi,

I've been backing up using rsnapshot directly on my running system.  I
recently decided to begin doing this properly, and to use LVM's
snapshot facility, so I wrote a basic, simple script to encapsulate the
rsnapshot call with LVM snapshot creation, mounting, umounting, and
removal:

#! /bin/sh

/sbin/lvcreate -L 2G -s -n home_backup /dev/lizzie/home 
/sbin/lvcreate -L 100M -s -n root_backup /dev/lizzie/root 
/sbin/lvcreate -L 1G -s -n var_backup /dev/lizzie/var 

/bin/mount /dev/lizzie/home_backup /mnt/home_backup/
/bin/mount /dev/lizzie/root_backup /mnt/root_backup/
/bin/mount /dev/lizzie/var_backup /mnt/var_backup/

/usr/bin/rsnapshot $1

/bin/umount /mnt/home_backup/
/bin/umount /mnt/root_backup/
/bin/umount /mnt/var_backup/

/sbin/lvremove -f lizzie/home_backup
/sbin/lvremove -f lizzie/root_backup
/sbin/lvremove -f lizzie/var_backup 

Originally this ran cleanly, but I've begun to see errors.  The last
run, for example, produced this in the removal stage:

Logical volume "home_backup" successfully removed
  /dev/block/254:13: stat failed: No such file or directory
  Path /dev/block/254:13 no longer valid for device(254,13)
  /dev/mapper/lizzie-home-real: stat failed: No such file or directory
  Path /dev/mapper/lizzie-home-real no longer valid for device(254,13)
  /dev/disk/by-id/dm-name-lizzie-home-real: stat failed: No such file or directory
  Path /dev/disk/by-id/dm-name-lizzie-home-real no longer valid for device(254,13)
  /dev/disk/by-id/dm-uuid-LVM-J0Vt1p4hrMWMgX0RTSCuurCGzEF8QgK7ryR1QntEe5bmluEs3y8T03MEpi3eAWpW-real: stat failed: No such file or directory
  Path /dev/disk/by-id/dm-uuid-LVM-J0Vt1p4hrMWMgX0RTSCuurCGzEF8QgK7ryR1QntEe5bmluEs3y8T03MEpi3eAWpW-real no longer valid for device(254,13)
  Logical volume "root_backup" successfully removed
  /dev/block/254:16: stat failed: No such file or directory
  Path /dev/block/254:16 no longer valid for device(254,16)
  /dev/disk/by-id/dm-name-lizzie-root-real: stat failed: No such file or directory
  Path /dev/disk/by-id/dm-name-lizzie-root-real no longer valid for device(254,16)
  /dev/mapper/lizzie-root-real: stat failed: No such file or directory
  Path /dev/mapper/lizzie-root-real no longer valid for device(254,16)
  /dev/disk/by-id/dm-uuid-LVM-J0Vt1p4hrMWMgX0RTSCuurCGzEF8QgK7vm806jRQCqyOajf8BIbDlvppK22X6gaL-real: stat failed: No such file or directory
  Path /dev/disk/by-id/dm-uuid-LVM-J0Vt1p4hrMWMgX0RTSCuurCGzEF8QgK7vm806jRQCqyOajf8BIbDlvppK22X6gaL-real no longer valid for device(254,16)
  Logical volume "var_backup" successfully removed

And in syslog, I see this (no idea if it's related):

Mar  5 01:58:44 localhost kernel: [108498.500356] kjournald starting.  Commit interval 5 seconds
Mar  5 01:58:44 localhost kernel: [108498.500751] EXT3-fs (dm-12): using internal journal
Mar  5 01:58:44 localhost kernel: [108498.541396] ext3_orphan_cleanup: deleting unreferenced inode 410007
Mar  5 01:58:44 localhost kernel: [108498.553973] EXT3-fs (dm-12): 1 orphan inode deleted
Mar  5 01:58:44 localhost kernel: [108498.553979] EXT3-fs (dm-12): recovery complete
Mar  5 01:58:44 localhost kernel: [108498.666683] EXT3-fs (dm-12): mounted filesystem with ordered data mode
Mar  5 01:58:44 localhost kernel: [108498.777321] kjournald starting.  Commit interval 5 seconds
Mar  5 01:58:44 localhost kernel: [108498.777690] EXT3-fs (dm-15): using internal journal
Mar  5 01:58:44 localhost kernel: [108498.819408] ext3_orphan_cleanup: deleting unreferenced inode 38137
Mar  5 01:58:44 localhost kernel: [108498.849373] ext3_orphan_cleanup: deleting unreferenced inode 45837
Mar  5 01:58:44 localhost kernel: [108498.861138] ext3_orphan_cleanup: deleting unreferenced inode 39563
Mar  5 01:58:44 localhost kernel: [108498.872315] ext3_orphan_cleanup: deleting unreferenced inode 46562
Mar  5 01:58:44 localhost kernel: [108498.875325] ext3_orphan_cleanup: deleting unreferenced inode 46494
Mar  5 01:58:44 localhost kernel: [108498.894348] ext3_orphan_cleanup: deleting unreferenced inode 46558
Mar  5 01:58:44 localhost kernel: [108498.894365] ext3_orphan_cleanup: deleting unreferenced inode 46568
Mar  5 01:58:44 localhost kernel: [108498.897359] ext3_orphan_cleanup: deleting unreferenced inode 46578
Mar  5 01:58:44 localhost kernel: [108498.907702] ext3_orphan_cleanup: deleting unreferenced inode 46532
Mar  5 01:58:44 localhost kernel: [108498.916388] ext3_orphan_cleanup: deleting unreferenced inode 46525
Mar  5 01:58:44 localhost kernel: [108498.922372] ext3_orphan_cleanup: deleting unreferenced inode 46068
Mar  5 01:58:44 localhost kernel: [108498.922410] ext3_orphan_cleanup: deleting unreferenced inode 46540
Mar  5 01:58:44 localhost kernel: [108498.922419] ext3_orphan_cleanup: deleting unreferenced inode 46528
Mar  5 01:58:44 localhost kernel: [108498.922428] ext3_orphan_cleanup: deleting unreferenced inode 46496
Mar  5 01:58:44 localhost kernel: [108498.922437] ext3_orphan_cleanup: deleting unreferenced inode 46569
Mar  5 01:58:44 localhost kernel: [108498.922446] ext3_orphan_cleanup: deleting unreferenced inode 46584
Mar  5 01:58:44 localhost kernel: [108498.928297] ext3_orphan_cleanup: deleting unreferenced inode 39145
Mar  5 01:58:44 localhost kernel: [108498.941464] EXT3-fs (dm-15): 17 orphan inodes deleted
Mar  5 01:58:44 localhost kernel: [108498.941470] EXT3-fs (dm-15): recovery complete
Mar  5 01:58:45 localhost kernel: [108499.078876] EXT3-fs (dm-15): mounted filesystem with ordered data mode
Mar  5 01:58:45 localhost kernel: [108499.203054] kjournald starting.  Commit interval 5 seconds
Mar  5 01:58:45 localhost kernel: [108499.203472] EXT3-fs (dm-18): using internal journal
Mar  5 01:58:45 localhost kernel: [108499.203478] EXT3-fs (dm-18): mounted filesystem with ordered data mode
Mar  5 01:59:51 localhost rsnapshot[15743]: /usr/bin/rsnapshot h: completed successfully

So: a) can anyone explain what either of these sets of messages means
and b) am I doing something wrong?

/var, /home, and / are separate LVM volumes; rsnapshot is configured
with these backup points:

backup  /mnt/root_backup/etc/           lizzie/
backup  /mnt/var_backup/log/            lizzie/
backup  /mnt/var_backup/mail/           lizzie/
backup  /boot/                          lizzie/
backup  /mnt/home_backup/               lizzie/
backup  /usr/local/                     lizzie/
backup  /root/                          lizzie/

[I don't bother snapshotting /boot/, /root/ and /usr/, since they're
not generally in use while I'm backing up, and they don't contain much
critical data anyway.]

Celejar
-- 
foffl.sourceforge.net - Feeds OFFLine, an offline RSS/Atom aggregator
mailmin.sourceforge.net - remote access via secure (OpenPGP) email
ssuds.sourceforge.net - A Simple Sudoku Solver and Generator


Reply to: