Root shell in system filesystem with GRUB












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.



Thank you very much. Any help or any explanation would be nice.



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










share|improve this question









New contributor




Miguel_sec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Whats your working directory when you get shell access? What is the results when you run ls?

    – kemotep
    6 hours ago






  • 1





    The root home directory is /root, use cd root from the root directory /.

    – GAD3R
    6 hours ago











  • @kemotep is the root directory and if I run ls I get all linux directories (/home, /var..)

    – Miguel_sec
    5 hours ago






  • 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
    4 hours ago
















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.



Thank you very much. Any help or any explanation would be nice.



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










share|improve this question









New contributor




Miguel_sec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Whats your working directory when you get shell access? What is the results when you run ls?

    – kemotep
    6 hours ago






  • 1





    The root home directory is /root, use cd root from the root directory /.

    – GAD3R
    6 hours ago











  • @kemotep is the root directory and if I run ls I get all linux directories (/home, /var..)

    – Miguel_sec
    5 hours ago






  • 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
    4 hours ago














1












1








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.



Thank you very much. Any help or any explanation would be nice.



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










share|improve this question









New contributor




Miguel_sec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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.



Thank you very much. Any help or any explanation would be nice.



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







debian shell linux-kernel grub2 grub






share|improve this question









New contributor




Miguel_sec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Miguel_sec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 4 hours ago







Miguel_sec













New contributor




Miguel_sec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 6 hours ago









Miguel_secMiguel_sec

83




83




New contributor




Miguel_sec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Miguel_sec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Miguel_sec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • Whats your working directory when you get shell access? What is the results when you run ls?

    – kemotep
    6 hours ago






  • 1





    The root home directory is /root, use cd root from the root directory /.

    – GAD3R
    6 hours ago











  • @kemotep is the root directory and if I run ls I get all linux directories (/home, /var..)

    – Miguel_sec
    5 hours ago






  • 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
    4 hours ago



















  • Whats your working directory when you get shell access? What is the results when you run ls?

    – kemotep
    6 hours ago






  • 1





    The root home directory is /root, use cd root from the root directory /.

    – GAD3R
    6 hours ago











  • @kemotep is the root directory and if I run ls I get all linux directories (/home, /var..)

    – Miguel_sec
    5 hours ago






  • 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
    4 hours ago

















Whats your working directory when you get shell access? What is the results when you run ls?

– kemotep
6 hours ago





Whats your working directory when you get shell access? What is the results when you run ls?

– kemotep
6 hours ago




1




1





The root home directory is /root, use cd root from the root directory /.

– GAD3R
6 hours ago





The root home directory is /root, use cd root from the root directory /.

– GAD3R
6 hours ago













@kemotep is the root directory and if I run ls I get all linux directories (/home, /var..)

– Miguel_sec
5 hours ago





@kemotep is the root directory and if I run ls I get all linux directories (/home, /var..)

– Miguel_sec
5 hours ago




2




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
4 hours ago





@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
4 hours ago










1 Answer
1






active

oldest

votes


















1














You can simply run



mount -a


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






share|improve this answer








New contributor




Entropy0 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • 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
    4 hours ago













  • @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
    4 hours ago











  • Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty

    – Miguel_sec
    4 hours ago











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Miguel_sec is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507536%2froot-shell-in-system-filesystem-with-grub%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














You can simply run



mount -a


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






share|improve this answer








New contributor




Entropy0 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • 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
    4 hours ago













  • @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
    4 hours ago











  • Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty

    – Miguel_sec
    4 hours ago
















1














You can simply run



mount -a


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






share|improve this answer








New contributor




Entropy0 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • 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
    4 hours ago













  • @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
    4 hours ago











  • Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty

    – Miguel_sec
    4 hours ago














1












1








1







You can simply run



mount -a


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






share|improve this answer








New contributor




Entropy0 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










You can simply run



mount -a


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







share|improve this answer








New contributor




Entropy0 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this answer



share|improve this answer






New contributor




Entropy0 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered 4 hours ago









Entropy0Entropy0

362




362




New contributor




Entropy0 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Entropy0 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Entropy0 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • 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
    4 hours ago













  • @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
    4 hours ago











  • Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty

    – Miguel_sec
    4 hours ago



















  • 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
    4 hours ago













  • @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
    4 hours ago











  • Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty

    – Miguel_sec
    4 hours ago

















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
4 hours ago







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
4 hours ago















@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
4 hours ago





@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
4 hours ago













Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty

– Miguel_sec
4 hours ago





Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty

– Miguel_sec
4 hours ago










Miguel_sec is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Miguel_sec is a new contributor. Be nice, and check out our Code of Conduct.













Miguel_sec is a new contributor. Be nice, and check out our Code of Conduct.












Miguel_sec is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507536%2froot-shell-in-system-filesystem-with-grub%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Accessing regular linux commands in Huawei's Dopra Linux

Can't connect RFCOMM socket: Host is down

Kernel panic - not syncing: Fatal Exception in Interrupt