[03:15] Server / ubuntu-server noob - How do I access the hard drives on the server? === genii is now known as genii-core === hmr is now known as hmr4c [08:57] Hi [08:57] I need help please with: Installing ubuntu 20.04 server: how to delete a partition? https://unix.stackexchange.com/questions/652999/installing-ubuntu-20-04-server-how-to-delete-a-partition [09:20] uluntu: if you want to, swich to one of the console shells of the installer and do it manually. [09:24] @Walex2: I already tried it using cfisk but couldn't delete the partition [09:24] uluntu: that is "unlikely" to say the least. [09:26] uluntu: could you explain in detail how 'cfdisk' could not delete the partition? [09:28] uluntu: ahhhh I now see a "detail" that you may have missed... [09:29] uluntu: the disk is 500GB, but the partitions 4 to 7 exist only in the next 500G. [09:29] uluntu: use 'fdisk' or 'gdisk' which do fewer checks. [09:30] uluntu: oops, no I mistook the first partition size for G instead of M. [09:30] uluntu: so really it is quite difficult that it did not delete. [09:31] uluntu: still, you can try to use 'fdisk' or 'gdisk' [09:31] @Walex2: sorry, read abov «fdisk» [09:32] uluntu: "cProg", on StackExchange too "was not able to format" is not a good answer. [09:32] @Walex2: I already tried fdisk but couldn't delete the partition [09:32] uluntu: again "couldn't delete the partition" is not a good description. [09:34] uluntu: a partition is just a line in a table. To delete is means just setting a file or two in that line to zero. Therefore "couldn't delete the partition" is "unlikely". [09:34] uluntu: a partition is just a line in a table. To delete is means just setting a field or two in that line to zero. Therefore "couldn't delete the partition" is "unlikely". [09:37] @Walex2: Ok. Let me start the computer, try again and let you know. [09:57] @Walex2: I am on the screen where I have the list of the 7 partitions [09:58] @Walex2: When I press space on the 7th partition I get 3 choices: close, edit, delete* [09:58] uluntu: uluntu: go back to the previous screen and switch to TTY2 as that guy on StackExchange recommended, and then use 'fdisk'. [14:57] What user does cloud-init run as? I've done `su - myuser` in a bash script I'm giving it and it says it's myuser (verified with $(pwd) in the script) but everything it creates etc is chowned to `root`... why? also stuff like $USER and $HOME aren't set [14:57] What are you trying to achieve? [14:58] I want to (1) download a binary and install it (2) change to a user (so I don't have to chown to fix permissions later) and download a bootstrap script and then run that bootstrap script [14:58] in verbatim bash, so user-data [14:59] (1) is done, (2) is done but `su - myuser` is still doing stuff as `root` and the lack of $USER and $HOME means I'm running "early" but I don't know how "early" [14:59] It sounds like your script assumes its in a login session [15:00] Ah, I am [15:00] What am I really in? [15:01] Try giving su "-l"? [15:02] Will do that, I assume I am in a non-interactive non-login shell then too? [15:02] Also if you're just trying to "bypass" cloud-init because you want to give it a simple script, you can just give it a bash script with a shebang as user data. [15:02] https://cloudinit.readthedocs.io/en/latest/topics/format.html [15:02] I am giving it a literal bash script with a shebang correct [15:02] `User-Data Script` that's the one (forgot to add `script` in my previous mentions of `user data`) [15:08] apparently rbasak `su - myuser` is exactly the same as `su -l myuser`, the `-` implies and does the same as `-l` which is what I tried before. I will try again now to double check though with it explicitly set using `-l` [15:09] tsujp: I wonder if there's not enough brought up at that point to make it work [15:09] tsujp: there's a dedicated cloud-init channel - #cloud-init [15:09] how can you defer or "wait" for more to be "brought up"? [15:09] ok [15:14] tsujp, you are executing a continuation script, like "su - user -c /path/to/script", right? [15:15] im doing `su - myuser; wget $THEFILES; ./run.sh` [15:15] so I am not, no [15:15] rfm ^ [15:16] tsujp, so the su runs, gets no input (since it's not attached to a termainl), exits, and wget runs (as root) in the original session [15:20] I'm missing something in my knowledge base here, `su` has to be attached to a terminal? Whereas `cloud-init` is just invoking the user-data-script via the shebang I give it, hence no terminal only a shell session [15:20] Is that right rfm? [15:23] tsujp, what's happening is: your script is running as root, with no terminal (probably stdin is /dev/null, might just be closed) ":su - user" will change to the user and exec a shell. that shell reads commands from stdin gets EOF, exits. you're back in the original shell as root... [15:24] RIIIIIIIIIIIIIIIIIIIIIIIIIIGHTTT [15:24] I just realised I've been analog-ing this to interactive `su -` [15:24] like.. in my own terminal on my local machine [15:24] Of course once the command ends it goes back to the original context, d'oh [15:24] So obvious once explained [15:24] Thank you rfm [15:24] tsujp, yup, unix does not work like that (some oses did!) [16:28] why does consistent network naming not work when I have >4 ports in my system? [16:34] this boot I have, enp3s0 enp7s0 eth0 ens1f1 ens1f0 eth3 [16:34] but those last 4 will change, and they never match === pizzaiolo is now known as pizza [17:06] hi pizza :) [17:07] nice nick you got there! [17:30] thanks utkarsh2102 === mybalzit1h is now known as mybalzitch [19:29] Is it possible to have a "first boot" script tha runs ONLY on first boot ? [19:30] Ussat: you could potentially use cloud-init for that? I guess, it would depend on how you deploy your machine [19:30] Hmm [19:31] Ussat: maybe check ConditionFirstBoot in systemd.unit(5)? [19:31] I have a couple ideas, I just did not know if Ubuntu had that functionality built in, thanks [19:31] sdeziel OK, thanks [19:36] Ussat: http://manpages.ubuntu.com/manpages/impish/en/man1/cloud-init-per.1.html [19:37] thanks [19:45] Ussat: also user-data like the following: https://paste.ubuntu.com/p/ZVFcGmVFrY/ per https://cloudinit.readthedocs.io/en/latest/topics/modules.html#scripts-per-once [19:46] choose your own adventure :) [19:48] "first boot" script tha runs ONLY on first boot ? you mean OEM install? [20:12] No OEM, but something I would like to run ONLY on the firs time we boot it after install, so , similar ? [20:12] Lots of good ideas, thanks === genii-core is now known as genii