/srv/irclogs.ubuntu.com/2021/06/08/#ubuntu-server.txt

BraveheartBSDServer / ubuntu-server noob - How do I access the hard drives on the server?03:15
=== genii is now known as genii-core
=== hmr is now known as hmr4c
uluntuHi08:57
uluntuI 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-partition08:57
Walex2uluntu: if you want to, swich to one of the console shells of the installer and do it manually.09:20
uluntu@Walex2: I already tried it using cfisk but couldn't delete the partition09:24
Walex2uluntu: that is "unlikely" to say the least.09:24
Walex2uluntu: could you explain in detail how 'cfdisk' could not delete the partition?09:26
Walex2uluntu: ahhhh I now see a "detail" that you may have missed...09:28
Walex2uluntu: the disk is 500GB, but the partitions 4 to 7 exist only in the next 500G.09:29
Walex2uluntu: use 'fdisk' or 'gdisk' which do fewer checks.09:29
Walex2uluntu: oops, no I mistook the first partition size for G instead of M.09:30
Walex2uluntu: so really it is quite difficult that it did not delete.09:30
Walex2uluntu: still, you can try to use 'fdisk' or 'gdisk'09:31
uluntu@Walex2: sorry, read abov «fdisk»09:31
Walex2uluntu: "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 partition09:32
Walex2uluntu: again "couldn't delete the partition" is not a good description.09:32
Walex2uluntu: 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
Walex2uluntu: 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:34
uluntu@Walex2:  Ok. Let me start the computer, try again and let you know.09:37
uluntu@Walex2: I am on the screen where I have the list of the 7 partitions09:57
uluntu@Walex2:  When I press space on the 7th partition I get 3 choices: close, edit, delete*09:58
Walex2uluntu: uluntu: go back to the previous screen and switch to TTY2 as that guy on StackExchange recommended, and then use 'fdisk'.09:58
tsujpWhat 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 set14:57
rbasakWhat are you trying to achieve?14:57
tsujpI 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 script14:58
tsujpin verbatim bash, so user-data14:58
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
rbasakIt sounds like your script assumes its in a login session14:59
tsujpAh, I am15:00
tsujpWhat am I really in?15:00
rbasakTry giving su "-l"?15:01
tsujpWill do that, I assume I am in a non-interactive non-login shell then too?15:02
rbasakAlso 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
rbasakhttps://cloudinit.readthedocs.io/en/latest/topics/format.html15:02
tsujpI am giving it a literal bash script with a shebang correct15:02
tsujp`User-Data Script` that's the one (forgot to add `script` in my previous mentions of `user data`)15:02
tsujpapparently 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:08
rbasaktsujp: I wonder if there's not enough brought up at that point to make it work15:09
rbasaktsujp: there's a dedicated cloud-init channel - #cloud-init15:09
tsujphow can you defer or "wait" for more to be "brought up"?15:09
tsujpok15:09
rfmtsujp, you are executing a continuation script, like "su - user -c /path/to/script", right?15:14
tsujpim doing `su - myuser; wget $THEFILES; ./run.sh`15:15
tsujpso I am not, no15:15
tsujprfm ^15:15
rfmtsujp, so the su runs, gets no input (since it's not attached to a termainl), exits, and wget runs (as root) in the original session15:16
tsujpI'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 session15:20
tsujpIs that right rfm?15:20
rfmtsujp, 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:23
tsujpRIIIIIIIIIIIIIIIIIIIIIIIIIIGHTTT15:24
tsujpI just realised I've been analog-ing this to interactive `su -`15:24
tsujplike.. in my own terminal on my local machine15:24
tsujpOf course once the command ends it goes back to the original context, d'oh15:24
tsujpSo obvious once explained15:24
tsujpThank you rfm15:24
rfmtsujp, yup, unix does not work like that (some oses did!)15:24
patdk-lapwhy does consistent network naming not work when I have >4 ports in my system?16:28
patdk-lapthis boot I have, enp3s0 enp7s0 eth0 ens1f1 ens1f0 eth316:34
patdk-lapbut those last 4 will change, and they never match16:34
=== pizzaiolo is now known as pizza
utkarsh2102hi pizza :)17:06
utkarsh2102nice nick you got there!17:07
pizzathanks utkarsh210217:30
=== mybalzit1h is now known as mybalzitch
UssatIs it possible to have a "first boot" script tha runs ONLY on first boot ?19:29
arif-aliUssat: you could potentially use cloud-init for that? I guess, it would depend on how you deploy your machine19:30
UssatHmm19:30
sdezielUssat: maybe check ConditionFirstBoot in systemd.unit(5)?19:31
UssatI have a couple ideas, I just did not know if Ubuntu had that functionality built in, thanks19:31
Ussatsdeziel OK, thanks19:31
rbasakUssat: http://manpages.ubuntu.com/manpages/impish/en/man1/cloud-init-per.1.html19:36
Ussatthanks19:37
blackboxswUssat: also user-data like the following: https://paste.ubuntu.com/p/ZVFcGmVFrY/   per https://cloudinit.readthedocs.io/en/latest/topics/modules.html#scripts-per-once19:45
blackboxswchoose your own adventure :)19:46
oerheks"first boot" script tha runs ONLY on first boot ? you mean OEM install?19:48
UssatNo OEM, but something I would like to run ONLY on the firs time we boot it after install, so , similar ?20:12
UssatLots of good ideas, thanks20:12
=== genii-core is now known as genii

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!