Hi all,
So I have an XFS file system within LVM which has an external log.
My mount option in FSTAB is;
/dev/vg_spock_data/lv_data /data xfs logdev=/dev/sdc1,nobarrier,logbufs=8,noatime,nodiratime 1 1
All is well no issues and very fast.
Now I'd like to snapshot this bad boy and then run rsnapshot to create a few days backup.
A snapshot volume is created w/o issue;
lvcreate -L250G -s -n datasnapshot /dev/vg_spock_data/lv_data
But when i try to mount the file system;
mount /dev/vg_spock_data/datasnapshot /snapshot -o nouuid,ro
I get this;
mount: wrong fs type, bad option, bad superblock on /dev/mapper/vg_anette_data-datasnapshot, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so
The command dmesg shows;
XFS (dm-3): filesystem is marked as having an external log; specify logdev on the mount command line. XFS (dm-3): SB validate failed
So I then use this mount option;
mount /dev/vg_anette_data/datasnapshot /snapshot -o logdev=/dev/sdc1,nouuid,ro
But get this error;
mount: /dev/mapper/vg_spock_data-datasnapshot already mounted or /snapshot busy
And the command dmesg shows;
XFS (dm-3): Invalid device [/dev/sdc1], error=-16
Am I doing something wrong or is this not possible?
I prefer being in error, I often am anyways.
Thanks in advance,
- aurf
So I have an XFS file system within LVM which has an external log.
A snapshot volume is created w/o issue;
But when i try to mount the file system; mount: /dev/mapper/vg_spock_data-datasnapshot already mounted or /snapshot busy
So the filesystem was built requiring an external log device? Let me guess, the original block device is still mounted and accessing its log device?
On Jun 21, 2013, at 2:58 PM, Joseph L. Casale wrote:
So I have an XFS file system within LVM which has an external log.
A snapshot volume is created w/o issue;
But when i try to mount the file system; mount: /dev/mapper/vg_spock_data-datasnapshot already mounted or /snapshot busy
So the filesystem was built requiring an external log device? Let me guess, the original block device is still mounted and accessing its log device?
Bingo, you got it.
I did this for speed.
The log device is on a pair of mirrored SSD drives I had lying around.
Might as well put em to use.
I have a feeling that freezing the XFS filesystem while a snapshot is made is the way to fix this.
However while I have tested freezing and XFS volume, I am a little shy on doing it on a live production system.
I'll wait until the weekend midnight.
It should be fast;
1) freeze 2) snap shot it 3) mount the snap shot 4) unfreeze 5) do my rsnapshot 6) then unmount and remove the snap shot volume
What do you think?
- aurf
On Jun 21, 2013, at 2:58 PM, Joseph L. Casale wrote:
So I have an XFS file system within LVM which has an external log.
A snapshot volume is created w/o issue;
But when i try to mount the file system; mount: /dev/mapper/vg_spock_data-datasnapshot already mounted or /snapshot busy
So the filesystem was built requiring an external log device? Let me guess, the original block device is still mounted and accessing its log device?
Based on some superb feed back from the XFS list, I have decided to place the log on an LVM rather then raw device that its on now and then freeze both and run the snapshot.
I'll first move the log to a diff device and convert sdc1 to LVM, move the log back and then snap away.
Word is that as of Centos 6.2, there is no need to use an external log due to this thing called delaylog.
However my env this server is being used for is very metadata intense, more so then normal.
Hence I do feel an external mirrored SSD log is the way to go.
- aurf
On Jun 21, 2013, at 2:58 PM, Joseph L. Casale wrote:
So I have an XFS file system within LVM which has an external log.
A snapshot volume is created w/o issue;
But when i try to mount the file system; mount: /dev/mapper/vg_spock_data-datasnapshot already mounted or /snapshot busy
So the filesystem was built requiring an external log device? Let me guess, the original block device is still mounted and accessing its log device? _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
So this worked;
truncate --size=2G logfile losetup /dev/loop0 logfile mount /dev/vg_anette_data/datasnapshot /snapshot -o logdev=/dev/loop0,nouuid,ro
Freezing the fs looks to make the log zero. So assigning any device/file for the external log would work.
My mistake was not making the log dev an LVM. However I don't if a log on an LVM would have worked anyways.
At any rate, HTH some one else.
- aurf
On Mon, Jun 24, 2013 at 07:49:21PM -0700, aurfalien wrote: ...
So this worked;
truncate --size=2G logfile losetup /dev/loop0 logfile mount /dev/vg_anette_data/datasnapshot /snapshot -o logdev=/dev/loop0,nouuid,ro
Freezing the fs looks to make the log zero. So assigning any device/file for the external log would work.
My mistake was not making the log dev an LVM. However I don't if a log on an LVM would have worked anyways.
At any rate, HTH some one else.
Thanks for the follow-up, and worth a wiki entry, imho
Cheers,
Tru
On 06/24/2013 07:49 PM, aurfalien wrote:
Freezing the fs looks to make the log zero. So assigning any device/file for the external log would work. My mistake was not making the log dev an LVM. However I don't if a log on an LVM would have worked anyways.
It wouldn't work. If you snapshot a filesystem (XFS or Ext4) with an external journal, you'll need to create a new one or modify the snapshot to specify no journal.
I've started a project to handle these things automatically and make it easier for everyone to make backups using snapshots. Initial work is here, and I'll be picking it up again when I'm back from Prague.
https://bitbucket.org/gordonmessmer/dragonsdawn-snapshot
I'll be adding support for XFS, NetApp, and btrfs soon.
On Jun 25, 2013, at 6:02 AM, Gordon Messmer wrote:
On 06/24/2013 07:49 PM, aurfalien wrote:
Freezing the fs looks to make the log zero. So assigning any device/file for the external log would work. My mistake was not making the log dev an LVM. However I don't if a log on an LVM would have worked anyways.
It wouldn't work. If you snapshot a filesystem (XFS or Ext4) with an external journal, you'll need to create a new one or modify the snapshot to specify no journal.
Ah, good to know. So the method I found, actually one suggested to me from the XFS list was the only solution.
I've started a project to handle these things automatically and make it easier for everyone to make backups using snapshots. Initial work is here, and I'll be picking it up again when I'm back from Prague.
https://bitbucket.org/gordonmessmer/dragonsdawn-snapshot
I'll be adding support for XFS, NetApp, and btrfs soon.
Nice info man, thank you very much.
- aurf