Artificial intelligent assistant

How to work out which drive and directory your system booted from if it is not mounted in /etc/fstab? My `/etc/fstab` doesn't include the disk the system booted from, basically because I made some changes and forgot to include this. The initial `/boot` and `/` directories are on different drives. I noticed this because when I upgrade the system and grub and kernel get updated the changes are made to the `/boot` directory under `/` which is not initial boot drive. How can I tell after boot with device was booted from and its directory? I want to mount it in `/etc/fstab` as `/boot` and delete or rename the `boot` directory under `/` to something else.

The root filesystem is passed to the kernel upon boot using the `root` argument. So you should be able to:


cat /proc/cmdline


and then look for `root=/some/path`, or perhaps `root=UUID=longstring`. For instance, I get:


BOOT_IMAGE=/boot/kernel-genkernel-x86_64-4.4.0-sabayon root=UUID=18f3b5a1-3994-43ef-ad6d-cb4c86ff5f95 ro quiet splash


If it's a path, it should point to something recognizable (like /dev/sdb3). If it's a UUID, copy the UUID, and run:


ls -la /dev/disk/by-uuid/[paste UUID here]


That should point to a symlink, like:


lrwxrwxrwx 1 root root 10 Apr 11 22:14 /dev/disk/by-uuid/06699502-fc90-48e4-86c2-cefdaf921e41 -> ../../sda4


Which should tell you which drive it was (in my case, the 4th partition of sda, iow, /dev/sda4)

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 6ad4673bc1705bcadecd0fe6f1002ecb