Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DELETED /usr/local #1191

Open
vermaden opened this issue Nov 28, 2024 · 9 comments
Open

DELETED /usr/local #1191

vermaden opened this issue Nov 28, 2024 · 9 comments
Assignees
Labels

Comments

@vermaden
Copy link

With this in /usr/local/etc/poudriere.conf config:

BASEFS=/poudriere
ZROOTFS=/usr/local/poudriere
POUDRIERE_DATA=/usr/local/poudriere/data

After creating first Jail - like that command below:

# poudriere jail -c -j 14-1-R-amd64 -v 14.1-RELEASE

Entire /usr/local will be deleted.

Why?

@vermaden vermaden added the bug label Nov 28, 2024
@vermaden
Copy link
Author

While this in /usr/local/etc/poudriere.conf config does NOT destroy entire /usr/local dir.

BASEFS=/usr/local/poudriere
ZROOTFS=/poudriere
POUDRIERE_DATA=/usr/local/poudriere/data

@vermaden
Copy link
Author

So the 'problem' seems to be ZROOTFS from my understanding ...

@bileslav
Copy link

Oh, hi, that's the thing I emailed you about some time ago. I hope no one got hurt too badly because of this. Backups, backups, backups...

@vermaden
Copy link
Author

vermaden commented Nov 30, 2024

@bileslav

Yes - I remember - I will add a warning to the article with link to this issue.

What is even more interesting ... there is NOTHING there at ZROOTFS place ...

root@poudriere-14-2:~ # find /poudriere/
/poudriere/
/poudriere/jails
root@poudriere-14-2:~ # 

@vermaden
Copy link
Author

Interesting ... I have just set ZROOTFS to /dev/null and everything still works ...

root@poudriere-14-2:~ # grep ^ZROOTFS /usr/local/etc/poudriere.conf
ZROOTFS=/dev/null

@MirLach
Copy link

MirLach commented Dec 1, 2024

What version of Poudriere?
Do you have ZPOOL set?

I am using this for a long time

ZPOOL=tank1
ZROOTFS=/vol1/poudriere
BASEFS=/vol1/poudriere
POUDRIERE_DATA=${BASEFS}/data

@vermaden
Copy link
Author

vermaden commented Dec 1, 2024

Great. But why it deletes /usr/local dir?

I already found a solution that works with ZROOTFS set to /dev/null value.

Fix the problem - do not seek the solution in workarounds.

It has to be bulletproof - not kill each user that did not lost tons of data by trying ...

@MirLach
Copy link

MirLach commented Dec 1, 2024

I haven't looked at the sources, but isn't it possible that it must not be a directory / filesystem that is already occupied by other data, because Poudriere is trying to create other sub-filesystems in it?
I agree that it should have some sort of security check so that the user doesn't lose data.

If I understand it right, the BASEFS is the target mount point, ZROOTFS is the filesystem under the ZPOOL.

In your case from the first post, is it true that the filesystem /usr/local/poudriere is set to mount under /poudriere?
Do you have ZPOOL set right?

@bdrewery bdrewery self-assigned this Dec 9, 2024
@bdrewery
Copy link
Member

bdrewery commented Dec 9, 2024

Whatever the reason for this, it is definitely NOT OKAY. We need a validation to prevent this. I'll look into it if no one else gets to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants