« first day (92 days earlier)      last day (2475 days later) » 

08:15
@Zanan he has his answer :) and tbh olis answer lacks in a few parts on newer ubuntus, for example mount bind the system resources
but i agree it is a duplicate and maybe even a merge candidate
what's missing from Oli's bind mounting? I've used that answer when my parents forget their passwords XD
i kow oli mounts direkly the resources
for d in dev sys run proc; do sudo mount --bind /$d /mnt/$d; done
my approach
sudo mount -o bind /dev /mnt/dev
sudo mount -o bind /dev/pts /mnt/dev/pts
sudo mount -t sysfs /sys /mnt/sys
sudo mount -t proc /proc /mnt/proc
has the benefit of not breaking chroot with /bin/bash not found
or at least thats what i got testing olis aproach in a VM
i tested first olis line and got the same message as the OP that /bin/bash is not found, then i tested the lines i use for my debootstrap install and this didnt throw the error
hmm I wonder why that happens
08:31
i guess becasue he mounts sys /sys /mnt/sys with bind option
but not sure about that
or at least this is what his for loop will result in ` sudo mount --bind sys /sys /mnt/sys`
what's the purpose of mounting /dev/pts?
arnt pts the ttys base ? let me look that up, but i have before to check on an UL answer which may be wrong, at least it rewarded me with a downvote right now
from bahamut
77
Q: Difference between pts and tty

pradeepchhetri Possible Duplicate: What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'? I always see pts and tty when I use the who command but I never understand how they are different? Can somebody please explain me this?

pseudo terminal slave... acronym of the day (sounds awful but is actually a thing we know and love)
ah ok, all i know installing via debootstrap does not work without it
my tutorial on my homepage took me a long while to assemble and to hone
and it is mostly a mix from so many sources that it became an own thing which actually is in google search results for debootstrap on page 3
nice! :)
08:41
gets about 200 unique clicks per month
gotta go, another busy day
 
4 hours later…
13:07
@EliahKaganping me if you're available please
@Videonauth Hi. I'm actually about to walk out the door. But what's up?
Btw I didn't get that ping because there were more letters appended to my name in it -- I just happened to notice the message. :)
ah i found an older answer of yours and have a few suggestions for it because in newer ubuntu systems it may fail
but can talk to you about later if your busy now
If you think they would be appropriate as an edit, please go ahead and edit and I can re-edit. If you think they might not be appropriate as an edit, then go ahead and tell me what answer and what changes and I'll consider/discuss them. I may read your messages (or your edit) when I get back but that's okay.
13:10
regarding this answer of you askubuntu.com/a/147023/522934 it may fail at part 8 because chroot will fail nowadays without the proper resources mounted
sudo mount -o bind /dev /mnt/dev
sudo mount -o bind /dev/pts /mnt/dev/pts
sudo mount -t sysfs /sys /mnt/sys
sudo mount -t proc /proc /mnt/proc
sudo chroot /mnt
You've verified that the chroot actually fails to occur without those mounted?
They've long been needed to do many things in a chroot. But at least when I wrote that answer, they weren't needed to run passwd it it successfully, on systems where /etc/passwd holds the password database.
well i told one user today to chroot into a system and he came back with the /bin/bash not found
not tested in particular which ones are essentially needed i tried to reproduce in a VM and simply mounted hoese after i confrmed without one of them chroot fails
Are you sure /dev/sda1 was their root partition?
and since this question is going to be dupe closed against the one you answered i came across this
They said:
in live CD after Ctrl-Alt-F1, I login as ubuntu and empty pass. then I do sudo mount /dev/sda1 /mnt. Then I do sudo chroot /mnt. This command did not work: "chroot: failed to run command '/bin/bash': No such file or directory. Nevertheless, chroot --help gives me a help. — zlon 24 hours ago
So, was /dev/sda1 their root partition?
13:17
seems so i never said any sda lines in my comments
Well they might just have been assuming that. A lot of guides use it as an example, including mine. I do say to check what it actually is, but someone who is just skimming might miss that.
guess he figured that on himself
Well he could just have been wrong about it, though.
I'll see your messages when I get back, which won't be in too long.
 
3 hours later…
16:47
@Videonauth Hi -- I'm back. So, you were saying that my answer might need to be updated for newer releases. But the OP is running 16.04, and I already know that neither chroot nor the passwd command inside a chroot needs those mounts to work on 16.04.
You need them for some things, like installing packages inside the chroot, but you do not need them for the chroot to succeed, and you do not need them to run the passwd command on systems where the password database is stored in /etc/passwd and /etc/shadow, because passwd just edits those files.
Furthermore, bash does not need those mounts just to run. Even if either of those programs did require those mounts--and I admit that it is possible that a future version of passwd might need them, though it would be strange and probably quite poor design choice if it did--the resulting error message would not say that /bin/bash was missing. That error message means what it says: /bin/bash is missing. Presumably the OP tried to chroot into the wrong partition.
It may be that they found your instructions about figuring out the partition more accessible, I'm not sure. (They did accept your answer.) It is also possible to get that error if the system is broken due to /bin/bash being deleted, though there's no reason to think that happened in this case, given that the problem seems to be solved for them now.
In any case, to be sure, I have just tested this in 16.04 and 17.10. It is not necessary to set up those mounts. Chrooting works fine without them, as does passwd in the chroot.
ok , then leave it as it is :), this is why i didnt go forward editing it myself and instead contacted you here
I think I should edit my answer to clarify what causes that error message, though, and also to clarify that those mounts aren't needed, since users may wonder about them (because they are needed for some other operations, like installing software -- I believe they're never needed just to start a shell, but that they're not needed with passwd is more the exception than the rule, because quite a few commands do need them).
I also recommend you edit your answer, though, because right now it seems to be saying that if setting up those mounts fails the one has to manually edit /etc/shadow. That is, even though you rightly advise that it is dangerous to do so, your answer currently says that those mounts must be set up and presents editing /etc/shadow as an alternative to chrooting.
If users have problem setting up those extra mounts (which they don't need to do anyway, for this), then they should definitely not react by attempting to edit /etc/shadow (or /mnt/etc/shadow) manually.
I think people use questions about how to chroot in to change passwords and group memberships to learn how to chroot in general, so I think it is reasonable that your answer explains how to mount /proc, /dev, and so forth. But I recommend that you present that as something that may be needed for other operations, and that should not be needed for running passwd.
As long as the system's password database is stored in /etc/passwd and /etc/shadow, it really does not make sense to have to mount anything extra to modify it, and my testing indicates that nothing has changed as far as that goes.
@Videonauth While I'm editing my post, I'd like to also add an explicit explanation of how to open GParted in GNOME 3. Right now it provides advice for GNOME 2--though it is not labeled as such, which I'll also fix--and for Unity as well as the old Unity 2D, but not for GNOME 3 with the GNOME Shell. (Most users don't need GParted for this, but its in the post as part of an explanation of how to figure out which is the correct rot partition on a system with many partitions.)
I don't run GNOME 3 myself, since I mostly use Lubuntu, so I don't actually know how to give good instructions for opening GParted on the live CD. I should be able to find this information by searching... but after I edit my post, would you be willing to take a look to make sure my GNOME 3 instructions for opening GParted are both correct and make sense?
17:03
will test them, but how did my writing which was under part 5 made you think that editing shadow is a good idea, its explizitely put under step 5 and was meant to say that if passwd user fails that then you might have to go and edit /etc/shadow
well changing the sentence to
> This should have done it already, but if that for whatever case setting passwords with the passwd command fails, you can go deep down the rabbit hole and [change the /etc/shadow file][2], but Beware: this is quite dangerous and you do this at your own risk.
17:15
--> askubuntu.com/a/980270/522934 if you want to have a look at it now
Thanks.
I think the change that improved it was really adding the notice about how the extra mounts aren't needed. Now if readers have a problem setting those mounts up, they are less likely to wrongly assume that the technique of just running passwd won't work, and less likely to edit the shadow file unnecessarily.
However, though probably not necessary to avoid danger, I would encourage you to edit further, because this wording is still wrong:
> Now you need to bind a few necessities from the Live USB/CD
how would you change this then?
Well, when I wrote a guide for this, I deliberately omitted those commands because, for the problem of resetting a password or adding users to groups, they're unnecessary. But if you want to keep them--and as I mentioned above, I think it might be reasonable--I suggest saying something like "Although this is not necessary for changing passwords, you might choose to create a more functional chroot in which you can run almost any program, by setting up a few more mounts that some programs need."
17:31
> Note: while it may not be neccesary to mount/bind the system resources for using only the passwd command you might want them too maybe in the case you want to actually directly update the system and other things while you're at it.
I just struggle right now thinking about how to change the sentence above that
well whatever i have cut ir out completely now
@EliahKagan you sometimes make me highly doubt in my English skills
17:48
How so?
well it feels im only writing gibberish, if you find so many flaws in my explanations
@Videonauth At least in this case, I don't think the problem was related to how it was said, so much as what was being said. When you originally wrote the post, you believed setting up those mount points was necessary, so you said it was necessary. When you subsequently edited the post to clarify that they aren't necessary, you didn't edit all the places that had said it was necessary.
I find this sort of thing in my own posts all the time, where I had though I had edited to change something, but I had only edited some of the places, thereby causing my post to assert two incompatible claims. In a few cases, I have done that and only realized the inconsistency years later when I revisited the post for an unrelated reason.
@EliahKagan me too :S I should go read a random sample of my answers...
@EliahKagan yeah but you're native English speaking, i have mostly to translate my thoughts to English, hell i even sometimes write the answer in German first and translate it then :)
Not that this addresses your concerns, but... that's awesome! Do you also publish the German language version of those answers somewhere? And if not, have you considered doing so? I suspect that would help many people--I believe there are many Ubuntu users who speak German (though I suppose you'd be more likely to know the number for that than I would). I know there are German language Ubuntu user support sites, or you could blog them, or use GitHub, etc.
18:03
well i ditched the german version then when i have done my translation, i mostly do this for answers which are a bit complicated
@EliahKagan screenshots for your answer incomming from 17.10
For running GParted from a 17.10 live environment?
yep
the application launcher is now at the bottom
but inside the live environment you not need to dearch much for gparted
its directly on page one
Thanks!
So is it correct for me to call that the "Activities panel"? Also, I can open that either by clicking the grid of squares on the lower-left corner of the screen or by pressing the Super key (which is also known as the Windows key), right? Or is that wrong? I should really have a VM with GNOME 3...
@Videonauth In your answer, had you wanted to keep the information about mounting /dev, /dev/pts, /sys, and /proc, but just couldn't think of how to explain its significance? I think that's what you were saying. If so, one possibility would be to make it like a footnote at the end.
For example, you could put a * or superscript 1 or something on the word "finally" in step 4, and then at the bottom, possibly after a horizontal rule (--- on a line by itself), put that symbol and an explanation of how, if you want a fully functional chroot where you can do things like installing software, then it is necessary to set up some additional mount points, which you would do by running these commands before running sudo chroot /mnt(and show the commands).
If you like, I can edit your answer to say that. I will not proceed to do so without you saying I should, though, because I don't know if this is actually what you want (and even if it is, perhaps you would prefer to do it yourself).
18:25
well you can edit it and no pressing the windows/super key does not open the application panel, super/windows key actually opens the activities where you can see an overview of what windows you have opened
hard to screenshot that lol
Oh, sorry. Yeah I've almost never used GNOME Shell. So how does one open the application panel?
only with that button down there i think let me chekc the keyboard shortcuts
only by that button click
There's no keyboard for it like in Unity?
not that i know of, and the list of keyboard shortcuts does not give hints either
Ok. But it is that button, on the lower left?
18:33
yes and here is what you get when pressing super, you might be able to enter your search on top middle
here it is not installed but you still get a hint of it if you click it it takes you to the software center
but that doesnt work for all packages sadly, but for gparted it works
on the live cd gparted is installed
19:03
@Videonauth Thanks again -- I've added an explanation of how to open GParted in a 17.10 live environment as well as the first two screenshots (and credited you). At least for now, I've held off on adding an alternative method or showing the second pair of screenshots, as the post is already very long and complicated.
@EliahKagan I dont mind you editing it
hehehe yes it can go out of hand quickly
@Videonauth Okay. I have to go afk for a few minutes but I'll edit it back into your post as a footnote when I get back.
np i need a break too, im already on the site since 6 this morning
now we have 8 pm :P
19:22
@Videonauth I've edited it.
thank you
No problem.
I didn't do this in my edit because it's not part of what you said you wanted and because it might be considered a radical change... but I recommend removing the part about mounting /boot. That's never necessary for changing passwords, and most people don't have separate /boot partitions anyway (though even if they did, their only significance to this problem would be that they might accidentally mount it to /mnt instead of their root partition, as the OP might have done).
These days, I think you're far more likely to have users with whole-disk encryption or LLVM, and even if not, those are the sorts of things that would actually require special instructions, while a separate boot partition doesn't because neither the password database nor the commands needed to modify it are ever stored on a separate /boot partition.
Unlike the instructions about /dev, /proc, and so forth, which I re-added in my edit, and which are widely useful in related contexts, I don't think there's really much reason to talk about mounting /boot here. But if you do keep it, then I recommend clarifying that it's unnecessary and also fixing it, since right now you say to mount the drive itself (you have sudo mount /dev/sdX /mnt/boot), but a /boot partition would be a partition (e.g., sudo mount /dev/sdXn /mnt/boot).
19:37
true that

« first day (92 days earlier)      last day (2475 days later) »