Re: Unexpected deletion behaviour between subvolume and normal directory

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

 



It turns out that I made a mistake when deleting the files: I typed
`rm -r /library/Music/*` instead of `rm -r /library/music/*` like I
intended. Substitute "Music" for "newmusic" in the examples above. So
I deleted files from the subvolume by mistake.

Now onto my next problem: `btrfs restore` is only able to recover
files that weren't yet deleted by my monumental stuff-up. It appears
`rm` went in alphabetical order, so I've lost only those artists that
started with A. B, or (some) C. However, systemd in its infinite
wisdom decided to automount my library drive while the restore was in
progress, and I suspect the space_cache mount option kicked in and
wiped the files forever. `btrfs-find-root` wasn't having much success,
but the undelete script here[1] is finding the files I wanted, so now
I'm just gradually working through everything.

I think I'll be able to recover most things.

[1]https://raw.githubusercontent.com/danthem/undelete-btrfs/master/undelete.sh

On Tue, 28 Jan 2020 at 22:38, Nikolay Borisov <nborisov@xxxxxxxx> wrote:
>
>
>
> On 28.01.20 г. 12:25 ч., Robbie Smith wrote:
> > I wanted to try to convert my music library from a directory into a
> > subvolume so I could use btrfs send/receive to transfer (changed)
> > files between it and a USB backup. A bit of Googling suggested that
> > the approach would be:
> >
> >> btrfs subvolume create /library/newmusic
> >> cp -ar --reflink=auto /library/music/* /library/newmusic/.
> >> rm -r /library/music
> >
> > After about 30 seconds I realised that it was deleting files from both
> > /library/music and /library/newmusic. It appears I've only lost
> > everything starting with A, B or C, so I unmounted the device, and am
> > currently trying to use `btrfs restore` to get the files back and it
> > doesn't seem to be finding them.
> >
> > I'm pretty sure deleting files from directory A isn't supposed to also
> > delete them from directory B, but that's what it did. Is this a bug?
> >
>
> Can you reproduce the same thing with a simple test directory? I was not
> able to reproduce it here?
>
> > Robbie
> >




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux