0

I'm running the following command:

[root@somehost ~]# ec2-consistent-snapshot --aws-credentials-file '/some/dir/file' --mysql --mysql-socket '/var/run/mysqld/mysql.sock' --mysql-username 'backup' --mysql-password 'password' --freeze-filesystem '/dev/xvda1' vol-xxxxxx

It returns this error:

xfs_freeze: cannot freeze filesystem at /dev/xvda1: Operation not supported
ec2-consistent-snapshot: ERROR: xfs_freeze -f /dev/xvda1: failed(256)
snap-eeb66393
xfs_freeze: cannot unfreeze filesystem mounted at /dev/xvda1: Invalid argument
ec2-consistent-snapshot: ERROR: xfs_freeze -u /dev/xvda1: failed(256)

This is being run on Debian Squeeze with the ext4 Linux filesystem.

Can anyone explain this error to me, or what might be its cause? When googling, I found information about it needing to be executed with sudo, but I'm performing the entire operation as root. I also found some posts about trying to run it after a CentOS upgrade using yum, but the situation appeared dissimilar. It's difficult to find things referring to this situation exactly. xfs_freeze is available for use on the filesystem. Is it possible that the filesystem, despite being ext4, somehow doesn't support freezing? Sorry if I've missed some bit of StackExchange etiquette with this post -- it's my first venture here!

1 Answers1

0

That's a really odd situation you've got there -- freezing has been supported in ext3/4 since 2.6.29, so assuming that you're running the stock Squeeze kernel (2.6.32), the operation should be supported (using the same ioctls that xfs_freeze uses for XFS filesystems, even).

I'd try running an xfs_freeze under strace, to make sure that the ioctl call that's coming back with "Operation not supported".

Also, if xvda1 is your root filesystem, be very, very cautious about freezing it -- it's not hard to get into a situation where you can't run the unfreeze operation, because the disk that xfs_freeze is on is frozen (which stops reads as well as writes) and so you can't read xfs_freeze to execute it to unfreeze the filesystem... it's reboot time then, no way around it. Put your important data on a separate EBS volume (just one more reason why EBS-backed instances aren't the win people think they are).

womble
  • 96,255
  • 29
  • 175
  • 230
  • That's actually what I was afraid of, and why I didn't run xfs_freeze by itself -- I wasn't sure I wouldn't get stuck. ;) Edit: This installation was stripped down for our purposes (rather JeOS), but I don't think something that fundamental would've been left out. I can ask for confirmation. – Michael Endsley Apr 07 '12 at 03:43
  • It's a kernel-level thing, and I don't think it can be disabled at kernel build time. Also, you're just as likely to lock up the machine calling `ec2-consistent-snapshot --freeze` on your root fs as you are calling `xfs_freeze` directly. – womble Apr 07 '12 at 04:32
  • Thanks again for that -- makes sense. I'll move the MySQL data off to its own volume and get back to this. – Michael Endsley Apr 07 '12 at 05:00
  • I moved the data off to its own volume (XFS filesystem this time), made a change to my.cnf, and was able to freeze it just fine last night. Thanks much! Now I'm implementing an EBS cleanup job (deleting old snapshots). – Michael Endsley Apr 07 '12 at 16:10