mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
FAQ: Add question about running fsck on live filesystems.
This commit is contained in:
@@ -695,12 +695,6 @@ can't easily do with libguestfs.
|
||||
|
||||
=end html
|
||||
|
||||
=head2 Can I use C<guestfish --ro> as a way to backup my virtual machines?
|
||||
|
||||
Usually this is not a good idea. The question is answered in more
|
||||
detail in this mailing list posting:
|
||||
L<https://www.redhat.com/archives/libguestfs/2010-August/msg00024.html>
|
||||
|
||||
=head2 Why can I write to the disk, even though I added it read-only?
|
||||
|
||||
=head2 Why does C<--ro> appear to have no effect?
|
||||
@@ -737,6 +731,37 @@ In guestfish, if you use the C<add> command, then disk is added
|
||||
read-write (unless you specify the C<readonly:true> flag explicitly
|
||||
with the command).
|
||||
|
||||
=head2 Can I use C<guestfish --ro> as a way to backup my virtual machines?
|
||||
|
||||
Usually this is I<not> a good idea. The question is answered in more
|
||||
detail in this mailing list posting:
|
||||
L<https://www.redhat.com/archives/libguestfs/2010-August/msg00024.html>
|
||||
|
||||
See also the next question.
|
||||
|
||||
=head2 Why can't I run fsck on a live filesystem using C<guestfish --ro>?
|
||||
|
||||
This command will usually I<not> work:
|
||||
|
||||
guestfish --ro -a /dev/vg/my_root_fs run : fsck /dev/sda
|
||||
|
||||
The reason for this is that qemu creates a snapshot over the original
|
||||
filesystem, but it doesn't create a strict point-in-time snapshot.
|
||||
Blocks of data on the underlying filesystem are read by qemu at
|
||||
different times as the fsck operation progresses, with host writes in
|
||||
between. The result is that fsck sees massive corruption (imaginary,
|
||||
not real!) and fails.
|
||||
|
||||
What you have to do is to create a point-in-time snapshot. If it's a
|
||||
logical volume, use an LVM2 snapshot. If the filesystem is located
|
||||
inside something like a btrfs/ZFS file, use a btrfs/ZFS snapshot, and
|
||||
then run the fsck on the snapshot. In practice you don't need to use
|
||||
libguestfs for this -- just run C</sbin/fsck> directly.
|
||||
|
||||
Creating point-in-time snapshots of host devices and files is outside
|
||||
the scope of libguestfs, although libguestfs can operate on them once
|
||||
they are created.
|
||||
|
||||
=head2 What's the difference between guestfish and virt-rescue?
|
||||
|
||||
A lot of people are confused by the two superficially similar tools we
|
||||
|
||||
Reference in New Issue
Block a user