Debian crashed, file system is read-only and cannot backup – How Do I find/mount a USB drive

debianfilesystemsread-onlyserver-crashes

We have a Debian server (vm's) here at work and the server crashed after a power failure. I can only boot the system in maintenance mode, and the whole file system is set to read only. I can run fsck though maintenance mode, however I would like to get a backup of some files before I do. Problem: I cannot access the net since there is no network connectivity in maintenance mode, and for some reason I try to add a USB flash drive to the computer but I can't find it through the console.

Question: how to you find/mount a usb drive on Debian? I have tried several resources from the internet but nothing worked.
Is there any other way I could get a backup of my files? I cannot start networking since the filesystem is set to read only.

Any help would be appreciated.

Best Answer

You can start networking without a writable filesystem -- you just probably can't use the init scripts to do it (newer versions of Debian use a tmpfs for this, but I'm going to assume you're not using one of those). Just use ip (or ifconfig if that's your bag) to give the interface an IP and bring it up:

ip addr add 192.0.2.69/24 dev eth0
ip link set eth0 up

If you need to talk to a machine off your local subnet, you can add a default route, too:

ip route add default via 192.0.2.254 dev eth0

Mounting a USB drive on Debian is exactly the same as it is on every other Linux distribution:

mount /dev/sdXN /mnt

You might be hitting limitations due to /etc/mtab not being writable, which is cool, just give mount the -n option.