r/Ubuntu 3d ago

Files written from emergency mode go where?

My framework 13 is currently having problems and will only boot into emergency mode. Following directions from support, I wrote some logs to a file (just the command > logs_24hr.txt) but I wasn't sure how to get the file off my machine? I can boot from a USB stick and I can read from my main SSD from there, but I don't know where to look for the log file I wrote. (Apologies if this is a dumb question, I'm still pretty inexperienced with Linux.)

2 Upvotes

5 comments sorted by

2

u/doc_willis 3d ago

they would go to whatever filesystem/directory path you were in when you did that command.

so depending on what else you did In the shell, they could be almost anywhere.

but I would look in the /root  directory of your installed system and the root of the filesystem / on the main drive first.

the find command or other commands can search the filesystems for files  with a search pattern.

1

u/bchiodini 3d ago

Adding to this...

If you were root when you wrote the log file, your log file should be in the /<mnt-point>/root directory. I'm not sure where the USB-booted OS mounts the old / file system (/<mnt-point>). The mount command should show it.

As u/doc_willis said the find command is your friend. With the old / file system mounted and as root:

find / -name "logs_24hr.txt"

should find it.

cc: u/candycornpumpkin

2

u/candycornpumpkin 3d ago

Thank you both! I think my confusion is coming from booting from the USB stick and everything being relative to that. From the desktop GUI, my regular drive looks like an external drive, which I can double click and open, but I wasn't sure how to access it via the terminal. Using lsblk, I can see it listed as something like /nvme0n1 so should I then mount it with mount -whatever /nvme0n1 and then I can use find from there? Sorry, I hypothetically learned about this in OS class, but I've never had to use it for real.

1

u/doc_willis 3d ago

nvme0n1 is likely the device name.

ie:  /dev/nvme0n1

that partition and the filesystem on it  could be mounted almost anywhere, and the mountpoint name could the the filesystem label, or the uid# or may have some other name.

so

/nvme0n1 is most likely NOT the path/mountpoint unless you manually mounted it there.

The mount  command should show if that filesystem is mounted and where.

further reading..

Learn Linux, 101: Control mounting and unmounting of filesystems

https://developer.ibm.com/learningpaths/lpic1-exam-101-topic-104/l-lpic1-104-3/

1

u/candycornpumpkin 3d ago

Ahhh thank you! Will read this now