[03:15] <BraveheartBSD> Server / ubuntu-server noob - How do I access the hard drives on the server?
[08:57] <uluntu> Hi
[08:57] <uluntu> 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] <Walex2> uluntu: if you want to, swich to one of the console shells of the installer and do it manually.
[09:24] <uluntu> @Walex2: I already tried it using cfisk but couldn't delete the partition
[09:24] <Walex2> uluntu: that is "unlikely" to say the least.
[09:26] <Walex2> uluntu: could you explain in detail how 'cfdisk' could not delete the partition?
[09:28] <Walex2> uluntu: ahhhh I now see a "detail" that you may have missed...
[09:29] <Walex2> uluntu: the disk is 500GB, but the partitions 4 to 7 exist only in the next 500G.
[09:29] <Walex2> uluntu: use 'fdisk' or 'gdisk' which do fewer checks.
[09:30] <Walex2> uluntu: oops, no I mistook the first partition size for G instead of M.
[09:30] <Walex2> uluntu: so really it is quite difficult that it did not delete.
[09:31] <Walex2> uluntu: still, you can try to use 'fdisk' or 'gdisk'
[09:31] <uluntu> @Walex2: sorry, read abov «fdisk»
[09:32] <Walex2> uluntu: "cProg", on StackExchange too "was not able to format" is not a good answer.
[09:32] <uluntu> @Walex2: I already tried fdisk but couldn't delete the partition
[09:32] <Walex2> uluntu: again "couldn't delete the partition" is not a good description.
[09:34] <Walex2> 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] <Walex2> 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] <uluntu> @Walex2:  Ok. Let me start the computer, try again and let you know.
[09:57] <uluntu> @Walex2: I am on the screen where I have the list of the 7 partitions
[09:58] <uluntu> @Walex2:  When I press space on the 7th partition I get 3 choices: close, edit, delete*
[09:58] <Walex2> uluntu: uluntu: go back to the previous screen and switch to TTY2 as that guy on StackExchange recommended, and then use 'fdisk'.
[14:57] <tsujp> 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] <rbasak> What are you trying to achieve?
[14:58] <tsujp> 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] <tsujp> in verbatim bash, so user-data
[14:59] <tsujp> (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] <rbasak> It sounds like your script assumes its in a login session
[15:00] <tsujp> Ah, I am
[15:00] <tsujp> What am I really in?
[15:01] <rbasak> Try giving su "-l"?
[15:02] <tsujp> Will do that, I assume I am in a non-interactive non-login shell then too?
[15:02] <rbasak> 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] <rbasak> https://cloudinit.readthedocs.io/en/latest/topics/format.html
[15:02] <tsujp> I am giving it a literal bash script with a shebang correct
[15:02] <tsujp> `User-Data Script` that's the one (forgot to add `script` in my previous mentions of `user data`)
[15:08] <tsujp> 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] <rbasak> tsujp: I wonder if there's not enough brought up at that point to make it work
[15:09] <rbasak> tsujp: there's a dedicated cloud-init channel - #cloud-init
[15:09] <tsujp> how can you defer or "wait" for more to be "brought up"?
[15:09] <tsujp> ok
[15:14] <rfm> tsujp, you are executing a continuation script, like "su - user -c /path/to/script", right?
[15:15] <tsujp> im doing `su - myuser; wget $THEFILES; ./run.sh`
[15:15] <tsujp> so I am not, no
[15:15] <tsujp> rfm ^
[15:16] <rfm> 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] <tsujp> 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] <tsujp> Is that right rfm?
[15:23] <rfm> 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] <tsujp> RIIIIIIIIIIIIIIIIIIIIIIIIIIGHTTT
[15:24] <tsujp> I just realised I've been analog-ing this to interactive `su -`
[15:24] <tsujp> like.. in my own terminal on my local machine
[15:24] <tsujp> Of course once the command ends it goes back to the original context, d'oh
[15:24] <tsujp> So obvious once explained
[15:24] <tsujp> Thank you rfm
[15:24] <rfm> tsujp, yup, unix does not work like that (some oses did!)
[16:28] <patdk-lap> why does consistent network naming not work when I have >4 ports in my system?
[16:34] <patdk-lap> this boot I have, enp3s0 enp7s0 eth0 ens1f1 ens1f0 eth3
[16:34] <patdk-lap> but those last 4 will change, and they never match
[17:06] <utkarsh2102> hi pizza :)
[17:07] <utkarsh2102> nice nick you got there!
[17:30] <pizza> thanks utkarsh2102
[19:29] <Ussat> Is it possible to have a "first boot" script tha runs ONLY on first boot ?
[19:30] <arif-ali> Ussat: you could potentially use cloud-init for that? I guess, it would depend on how you deploy your machine
[19:30] <Ussat> Hmm
[19:31] <sdeziel> Ussat: maybe check ConditionFirstBoot in systemd.unit(5)?
[19:31] <Ussat> I have a couple ideas, I just did not know if Ubuntu had that functionality built in, thanks
[19:31] <Ussat> sdeziel OK, thanks
[19:36] <rbasak> Ussat: http://manpages.ubuntu.com/manpages/impish/en/man1/cloud-init-per.1.html
[19:37] <Ussat> thanks
[19:45] <blackboxsw> 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] <blackboxsw> choose your own adventure :)
[19:48] <oerheks> "first boot" script tha runs ONLY on first boot ? you mean OEM install?
[20:12] <Ussat> No OEM, but something I would like to run ONLY on the firs time we boot it after install, so , similar ?
[20:12] <Ussat> Lots of good ideas, thanks