Issue: I have an AWS t2.micro (virtual machine) instance (name:webserver) set up with Ubuntu 14.04 LTS. The instance is unusable due to a configuration file that I edited improperly and saved. I need to get access to the file system of the virtual machine so I can fix the broken configuration file in the instance (name:webserver), and (hopefully) recover the instance (VM) so it is again usable.
Configuration: AWS t2.micro instance (name:webserver) set up with Ubuntu 14.04 LTS. This instance is stopped and the EBS volume (name:broken) containing the instance (name:webserver) has been mounted at /mnt on a second AWS t2.micro instance (name:recovery) running Ubuntu 14.04 LTS (the same OS as the stopped instance). The mount command used was:
sudo mount -t sysfs xvdf /mnt
I also tried with other FS types (ext2, ext4, auto), none worked.
The fsblk command produced this output:
ubuntu@ip-172-xx-xx-xxx:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 8G 0 disk
└─xvda1 202:1 0 8G 0 part /
xvdf 202:80 0 24G 0 disk
└─xvdf1 202:81 0 24G 0 part
Mounting xvdf1 with the command:
ubuntu@ip-172-xx-xx-xxx:~$ sudo mount -t sysfs xvdf1 /data
produces the same content in /data as in the /mnt directory , as described below.
Question: How do I access the Ubuntu file system in the mounted EBS volume (name:broken)? The directories and files I'm looking for are per this list, taken from the server (name:recovery).
total 84
drwxr-xr-x 22 root root 4096 Jul 27 05:35 .
drwxr-xr-x 22 root root 4096 Jul 27 05:35 ..
drwxr-xr-x 2 root root 4096 Mar 25 11:52 bin
drwxr-xr-x 3 root root 4096 Mar 25 11:52 boot
drwxr-xr-x 13 root root 4020 Jul 25 16:53 dev
drwxr-xr-x 89 root root 4096 Jul 25 21:37 etc
drwxr-xr-x 3 root root 4096 Jul 25 15:46 home
lrwxrwxrwx 1 root root 33 Mar 25 11:51 initrd.img -> boot/initrd.img-3.13.0-48-generic
drwxr-xr-x 21 root root 4096 Mar 25 11:51 lib
drwxr-xr-x 2 root root 4096 Mar 25 11:50 lib64
drwx------ 2 root root 16384 Mar 25 11:53 lost+found
drwxr-xr-x 2 root root 4096 Mar 25 11:50 media
drwxr-xr-x 2 root root 4096 Mar 25 11:50 opt
dr-xr-xr-x 109 root root 0 Jul 25 15:46 proc
drwx------ 3 root root 4096 Jul 25 15:46 root
drwxr-xr-x 18 root root 660 Jul 26 06:27 run
drwxr-xr-x 2 root root 4096 Mar 25 11:52 sbin
drwxr-xr-x 2 root root 4096 Mar 25 11:50 srv
drwxrwx--- 13 root root 0 Jul 26 14:17 sys
The same directories and files should be somewhere in the mounted volume (name:broken), but I've not been able to find them.
Comment / status: When I use ls -al /mnt -- I get a very nice listing of the virtual machine's directories and files, per the following.
total 4
drwxrwx--- 13 root root 0 Jul 26 14:17 .
drwxr-xr-x 22 root root 4096 Jul 27 05:35 ..
drwxr-xr-x 2 root root 0 Jul 25 15:46 block
drwxr-xr-x 28 root root 0 Jul 25 15:46 bus
drwxr-xr-x 46 root root 0 Jul 25 15:46 class
drwxr-xr-x 4 root root 0 Jul 25 15:46 dev
drwxr-xr-x 16 root root 0 Jul 25 15:46 devices
drwxr-xr-x 4 root root 0 Jul 25 15:46 firmware
drwxr-xr-x 7 root root 0 Jul 25 15:46 fs
drwxr-xr-x 5 root root 0 Jul 25 21:38 hypervisor
drwxr-xr-x 7 root root 0 Jul 25 15:46 kernel
drwxr-xr-x 92 root root 0 Jul 25 15:46 module
drwxr-xr-x 2 root root 0 Jul 25 21:38 power
These directories and files are all about the the virtual machine that runs Ubuntu 14.04. So far as I can tell, there is nothing in this file structure related to the Ubuntu file system itself. I've done a full tree listing of /mnt, and searched it for the Ubuntu system directories and files -- without success.
I've reviewed the AWS documentation and the Ubuntu man pages for directories and files, and for access to them. I've also searched in SuperUser, AskUbuntu and StackOverflow (and other forums). So far I've not been able to suss out the answer, so am turning to the experts at SuperUser for assistance.
My suspicion is that the root of the Ubuntu file system is a link, somewhere in the /mnt structure; and that a bind command of some form will get me access to it. So far, though, I don't see where / how to do this.
TIA for help with improving the question or a real answer.
/mnt
? What is the relevant line of output fromdf -h
? Also showlsblk
output, please. What you are trying to do should be very straightforward...-t sysfs
in the first place. Simplymount /dev/xvdf1 /mnt
would have worked.