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.
[26729.124569] Write(10): 2a 00 03 96 5a b0 00 00 08 00
[26729.124576] end_request: I/O error, dev sda, sector 60185264
[26729.125298] Buffer I/O error on device sda2, logical block 4593494
[26729.125986] lost page write due to I/O error on sda2
For me, that's pretty strong evidence that your /dev/sda
is on its way out. You could run a smartctl test on it for confirmation (smartctl -t long /dev/sda
), but I'd be inclined to replace it as soon as possible.
Edit: the smartctl
command I gave is correct as written. Thanks for showing the failure mode in your question; this looks like either you have very old hardware, or there's some kind of translation layer in the way: either virtualisation, or a hardware RAID controller. Can you clarify?
May I repeat my assertion that your HDD is on its way out? Testing's all very well, but getting the hardware replaced before your system packs up and your data are lost should be your priority now. Please, at the very least make sure that your backups are completely up-to-date before wasting any more time on smartctl
.
Edit 2: it's certainly worth trying what they've suggested - fscking the file system - but I have little hope that that will fix the problem because your FS isn't dropping to ro mode because of FS inconsistencies, it's dropping to ro mode because of problems talking to the underlying hardware.
If they have confidence that the underlying hardware is fine, then it's an issue between the kernel and the hardware, ie, the virtualisation layer. You should probably get your VPS provider to confirm that the distro, and the exact kernel version, that you're running are fully supported on their VPS system.
Best Answer
You're running the embedded version, which stays read-only mounted to not kill flash media with its limited write lifetime. You can mount to read write by running /etc/rc.conf_mount_rw and when finished, mount back to read only with /etc/rc.conf_mount_ro.
If you're running on a hard drive or SSD you can run the full install version, which stays read-write mounted all the time.