You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[devserver][clean_disk] make antlir2-out cleaner more resilient
Summary:
The top level `antlir2-out` dir has not held subvolumes since D76380320.
But there might still be devservers that have subvols in the old location. This
just cleans up this script to handle
Test Plan:
Created a convoluted setup with subvols in both `antlir2-out/` and
`antlir2-out/subvols`, including nested subvolumes in read-only parents. This
new script still cleaned it up.
```
[email protected] in fbsource/antlir2-out
❯ btrfs subvolume create foo
Create subvolume './foo'
[email protected] in fbsource/antlir2-out
❯ btrfs subvolume create subvols/bar
Create subvolume 'subvols/bar'
[email protected] in fbsource/antlir2-out
❯ btrfs subvolume create subvols/bar/baz
Create subvolume 'subvols/bar/baz'
[email protected] in fbsource/antlir2-out
❯ sudo btrfs property set subvols/bar ro true
[email protected] in fbsource/antlir2-out
❯ tree
.
├── foo
└── subvols
└── bar
└── baz
4 directories, 0 files
[email protected] in fbsource/antlir2-out
❯ ~fbcode/antlir/clean-antlir2-out.sh
+ '[' '!' -d antlir2-out ']'
+ '[' '!' -d antlir2-out ']'
+ pushd antlir2-out
/data/users/vmagro/fbsource/antlir2-out /data/users/vmagro/fbsource
+ find . -maxdepth 2 -depth -type d -inum 256 -exec sudo btrfs property set '{}' ro false ';'
+ sudo find . -depth -type d -inum 256 -exec btrfs subvolume delete '{}' ';'
Delete subvolume 3169 (no-commit): '/data/users/vmagro/fbsource/antlir2-out/subvols/bar/baz'
Delete subvolume 3168 (no-commit): '/data/users/vmagro/fbsource/antlir2-out/subvols/bar'
Delete subvolume 3167 (no-commit): '/data/users/vmagro/fbsource/antlir2-out/foo'
[email protected] in fbsource/antlir2-out
❯ tree
.
└── subvols
1 directory, 0 files
```
Rollback Plan:
Reviewed By: sergeyfd
Differential Revision: D81242825
fbshipit-source-id: abf6737aa74418c8339a08f526941ad6d4b0c536
0 commit comments