1

I'm learning about GRUB and, after search for a while, I tried to get a root shell changing the kernel load string:

/boot/vmlinuz-4.9.0-8amd64 root=UUID=e8485edc.... ro single

to

/boot/vmlinuz-4.9.0-8amd64 root=UUID=e8485edc.... rw single init=/bin/bash

It works and I get a root console. However, The filesystem mounted on "/" directory of this filesystem is not the filesystem mounted on the "original" system. I checked if it is a chroot but it isn't.

Could someone explain what is the filesystem mounted on / in this root shell?

How can I access to the original fs? I'm on Debian 7.

EDIT

I notice that I get root access to a system filesystem (the fs mounted on the / partition). However, I would like to get into other partitions such as /home.

Explained:

I have, for example, 5 partitions (/, /home, /var, /usr, swap). When I do the trick and I get a root shell, I get into / partition, so i'm not able to see what is in home partition. However, fdisk -l command shows all partitions but df -h only shows two fs of two of these partitions (/ and /usr). I would like to see what is in /home partition. What can I do

  • Whats your working directory when you get shell access? What is the results when you run ls? – kemotep Mar 20 at 20:33
  • @kemotep is the root directory and if I run ls I get all linux directories (/home, /var..) – Miguel_sec Mar 20 at 21:21
  • 2
    @GAD3R I think I don't have explained myself correctly. I have, for example, 5 partitions (/, /home, /var, /usr, swap). When I do the trick and I get a root shell, I get into / partition, so i'm not able to see what is in home partition. However, fdisk -l command shows all partitions but df -h only shows two fs of two of these partitions (/ and /usr). I would like to see what is in /home partition. What can I do? – Miguel_sec Mar 20 at 21:57
2

You can simply run

mount -a

to mount all the filesystems that your system would usually mount (ie. all the entries in /etc/fstab)

  • Can you believe that I was reloading webpage to say that I found the solution? Yep, that was the issue. I don't knwo why fs weren't mounted but that's it. Thanks! – Miguel_sec Mar 20 at 22:34
  • @Miguel_sec Wekk, they weren't loaded since that is usually done by your OS's init processes (be they init.d, systemd or something else entirely), which you overwrote with init=/bin/bash. – Entropy0 Mar 20 at 22:36
  • Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty – Miguel_sec Mar 20 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.