* Re: List missing files on a degraded read-only btrfs mount
2016-03-05 20:32 List missing files on a degraded read-only btrfs mount Justin Madru
@ 2016-03-06 6:52 ` Duncan
0 siblings, 0 replies; 2+ messages in thread
From: Duncan @ 2016-03-06 6:52 UTC (permalink / raw)
To: linux-btrfs
Justin Madru posted on Sat, 05 Mar 2016 12:32:31 -0800 as excerpted:
> I have a btrfs filesystem spanning 3 drives. The metadata is using raid1
> (mirroring), but the data is using single, so no mirroring or parity
> just spanning. For example:
>
> mkfs.btrfs -m raid1 -d single /dev/sda /dev/sdb /dev/sdc
>
> One of the drives, /dev/sdb, had a hardware failure before I could
> replace it. I'm able to mount the filesystem in read-only using:
>
> mount -o degraded,ro /dev/sda /mnt/data
>
> But how do I list the files that were on the failed drive?
I don't believe there's a simple, admin-level command, to list only the
files that happened to be on a particular drive.
What you /can/ do is just do a global copy to somewhere else, and
unaffected files will copy, while affected ones will fail.
The other alternative is to use btrfs restore on the unmounted
filesystem, restoring the files that are possible to some other
location. Note that by default, the restored files will be written as
root, using umask, with symlinks skipped, but on reasonably recent btrfs-
progs, restore has options that allow you to restore metadata such as
ownership/perms/times, and symlinks, if you wish.
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
^ permalink raw reply [flat|nested] 2+ messages in thread