Root shell in system filesystem with GRUB
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
New contributor
add a comment |
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
New contributor
Whats your working directory when you get shell access? What is the results when you runls
?
– kemotep
6 hours ago
1
The root home directory is/root
, usecd root
from the root directory/
.
– GAD3R
6 hours ago
@kemotep is the root directory and if I runls
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 butdf -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
add a comment |
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
New contributor
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
debian shell linux-kernel grub2 grub
New contributor
New contributor
edited 4 hours ago
Miguel_sec
New contributor
asked 6 hours ago
Miguel_secMiguel_sec
83
83
New contributor
New contributor
Whats your working directory when you get shell access? What is the results when you runls
?
– kemotep
6 hours ago
1
The root home directory is/root
, usecd root
from the root directory/
.
– GAD3R
6 hours ago
@kemotep is the root directory and if I runls
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 butdf -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
add a comment |
Whats your working directory when you get shell access? What is the results when you runls
?
– kemotep
6 hours ago
1
The root home directory is/root
, usecd root
from the root directory/
.
– GAD3R
6 hours ago
@kemotep is the root directory and if I runls
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 butdf -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
add a comment |
1 Answer
1
active
oldest
votes
You can simply run
mount -a
to mount all the filesystems that your system would usually mount (ie. all the entries in /etc/fstab
)
New contributor
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 theyinit.d
,systemd
or something else entirely), which you overwrote withinit=/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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
You can simply run
mount -a
to mount all the filesystems that your system would usually mount (ie. all the entries in /etc/fstab
)
New contributor
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 theyinit.d
,systemd
or something else entirely), which you overwrote withinit=/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
add a comment |
You can simply run
mount -a
to mount all the filesystems that your system would usually mount (ie. all the entries in /etc/fstab
)
New contributor
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 theyinit.d
,systemd
or something else entirely), which you overwrote withinit=/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
add a comment |
You can simply run
mount -a
to mount all the filesystems that your system would usually mount (ie. all the entries in /etc/fstab
)
New contributor
You can simply run
mount -a
to mount all the filesystems that your system would usually mount (ie. all the entries in /etc/fstab
)
New contributor
New contributor
answered 4 hours ago
Entropy0Entropy0
362
362
New contributor
New contributor
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 theyinit.d
,systemd
or something else entirely), which you overwrote withinit=/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
add a comment |
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 theyinit.d
,systemd
or something else entirely), which you overwrote withinit=/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
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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
, usecd 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 butdf -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