Root shell in system filesystem with GRUB2019 Community Moderator ElectionHow does Linux deal with a separate /boot partition?installing grub and a working kernel over an old and broken debian systemGrub error: unknown filesystem. (all partitions are unknown)Read the UUID of a known partition into a variable in GRUBArch Linux: GRUB does not load after installationHow to format drive without losing grub?Grub won't boot from GPT RAID (gave up waiting for root device)Ubuntu Server 16.04.3LTS Squashfs as root from Grubgrub rescue ls – no partitions shown?Installing GRUB on an nvme drive
Did the UK lift the requirement for registering SIM cards?
The IT department bottlenecks progress, how should I handle this?
How do I fix the group tension caused by my character stealing and possibly killing without provocation?
Circuit Analysis: Obtaining Close Loop OP - AMP Transfer function
Is there a RAID 0 Equivalent for RAM?
Why does AES have exactly 10 rounds for a 128-bit key, 12 for 192 bits and 14 for a 256-bit key size?
C++ check if statement can be evaluated constexpr
15% tax on $7.5k earnings. Is that right?
Delete multiple columns using awk or sed
"It doesn't matter" or "it won't matter"?
How to preserve electronics (computers, iPads and phones) for hundreds of years
Is my low blitz game drawing rate at www.chess.com an indicator that I am weak in chess?
Will number of steps recorded on FitBit/any fitness tracker add up distance in PokemonGo?
Why is so much work done on numerical verification of the Riemann Hypothesis?
Is it necessary to use pronouns with the verb "essere"?
Microchip documentation does not label CAN buss pins on micro controller pinout diagram
What is the highest possible scrabble score for placing a single tile
awk assign to multiple variables at once
How could a planet have erratic days?
Find the next value of this number series
Can I say "fingers" when referring to toes?
Non-trope happy ending?
Mimic lecturing on blackboard, facing audience
Why can't the Brexit deadlock in the UK parliament be solved with a plurality vote?
Root shell in system filesystem with GRUB
2019 Community Moderator ElectionHow does Linux deal with a separate /boot partition?installing grub and a working kernel over an old and broken debian systemGrub error: unknown filesystem. (all partitions are unknown)Read the UUID of a known partition into a variable in GRUBArch Linux: GRUB does not load after installationHow to format drive without losing grub?Grub won't boot from GPT RAID (gave up waiting for root device)Ubuntu Server 16.04.3LTS Squashfs as root from Grubgrub rescue ls – no partitions shown?Installing GRUB on an nvme drive
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
yesterday
@kemotep is the root directory and if I runls
I get all linux directories (/home, /var..)
– Miguel_sec
yesterday
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
yesterday
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 11 hours ago
GAD3R
27.3k1858113
27.3k1858113
New contributor
asked yesterday
Miguel_secMiguel_sec
133
133
New contributor
New contributor
Whats your working directory when you get shell access? What is the results when you runls
?
– kemotep
yesterday
@kemotep is the root directory and if I runls
I get all linux directories (/home, /var..)
– Miguel_sec
yesterday
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
yesterday
add a comment |
Whats your working directory when you get shell access? What is the results when you runls
?
– kemotep
yesterday
@kemotep is the root directory and if I runls
I get all linux directories (/home, /var..)
– Miguel_sec
yesterday
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
yesterday
Whats your working directory when you get shell access? What is the results when you run
ls
?– kemotep
yesterday
Whats your working directory when you get shell access? What is the results when you run
ls
?– kemotep
yesterday
@kemotep is the root directory and if I run
ls
I get all linux directories (/home, /var..)– Miguel_sec
yesterday
@kemotep is the root directory and if I run
ls
I get all linux directories (/home, /var..)– Miguel_sec
yesterday
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
yesterday
@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
yesterday
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
yesterday
@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
yesterday
Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty
– Miguel_sec
yesterday
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
yesterday
@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
yesterday
Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty
– Miguel_sec
yesterday
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
yesterday
@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
yesterday
Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty
– Miguel_sec
yesterday
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 yesterday
Entropy0Entropy0
562
562
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
yesterday
@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
yesterday
Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty
– Miguel_sec
yesterday
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
yesterday
@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
yesterday
Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty
– Miguel_sec
yesterday
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
yesterday
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
yesterday
@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
yesterday
@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
yesterday
Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty
– Miguel_sec
yesterday
Oh wait, thanks! I thought I understand it at 100% but I didn't. That is interesting :) Ty
– Miguel_sec
yesterday
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
yesterday
@kemotep is the root directory and if I run
ls
I get all linux directories (/home, /var..)– Miguel_sec
yesterday
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
yesterday