Mount root filesystem from initramfs
Clash Royale CLAN TAG#URR8PPP
up vote
11
down vote
favorite
It's a common scenario. For whatever reason, the initramfs (OpenSUSE, in case it matters) has failed to find the root filesystem, so it drops you into a rescue shell. I know perfectly well what device needs to be mounted though. My question:
What is the correct procedure to mount the root filesystem and continue the boot sequence?
Presumably that's the whole point of the rescue console. And yet, nobody seems to have documented how you actually do this.
Obviously I can mount the root filesystem somewhere. But how do I make that the root of the filesystem tree? And now do I continue the normal boot process after that? (I thought just exiting the shell would do it... but it doesn't.) What exactly do you need to get mounted before you continue, and how do you continue?
boot opensuse startup initramfs root-filesystem
add a comment |Â
up vote
11
down vote
favorite
It's a common scenario. For whatever reason, the initramfs (OpenSUSE, in case it matters) has failed to find the root filesystem, so it drops you into a rescue shell. I know perfectly well what device needs to be mounted though. My question:
What is the correct procedure to mount the root filesystem and continue the boot sequence?
Presumably that's the whole point of the rescue console. And yet, nobody seems to have documented how you actually do this.
Obviously I can mount the root filesystem somewhere. But how do I make that the root of the filesystem tree? And now do I continue the normal boot process after that? (I thought just exiting the shell would do it... but it doesn't.) What exactly do you need to get mounted before you continue, and how do you continue?
boot opensuse startup initramfs root-filesystem
2
I could be wrong, but I think once you're in a rescue shell you can't continue the current boot, you fix things so the next boot will succeed
â Eric Renouf
Jun 23 '16 at 14:14
@EricRenouf manually booting the full system may very well be the easiest way to fix such an issue. I had problems in the past where the initramfs failed to open my cryptsetup-luks encrypted root partition, and the easiest fix was to manually boot it and then runupdate-initramfs -u
. I absolutely couldn't get it working when I justchroot
ed into the root filesystem from a rescue system; the resulting initramfs was always broken.
â Martin von Wittich
Jun 23 '16 at 15:13
Is it actually an initrd, or an initramfs? (Just because the file is calledinitrd
doesn't mean that it's one: most distributions have switched toinitramfs
but keep calling the fileinitrd
.) What distribution are you using (as what the initrd/initramfs does depends on what the distribution put there)?
â Gilles
Jun 23 '16 at 22:40
@Gilles I'm pretty sure it's actually initramfs. Not sure if it actually makes a difference though; either way, I've got a mini filesystem and I need to mount the real filesystem. (OpenSUSE, in case it matters.)
â MathematicalOrchid
Jun 24 '16 at 7:57
add a comment |Â
up vote
11
down vote
favorite
up vote
11
down vote
favorite
It's a common scenario. For whatever reason, the initramfs (OpenSUSE, in case it matters) has failed to find the root filesystem, so it drops you into a rescue shell. I know perfectly well what device needs to be mounted though. My question:
What is the correct procedure to mount the root filesystem and continue the boot sequence?
Presumably that's the whole point of the rescue console. And yet, nobody seems to have documented how you actually do this.
Obviously I can mount the root filesystem somewhere. But how do I make that the root of the filesystem tree? And now do I continue the normal boot process after that? (I thought just exiting the shell would do it... but it doesn't.) What exactly do you need to get mounted before you continue, and how do you continue?
boot opensuse startup initramfs root-filesystem
It's a common scenario. For whatever reason, the initramfs (OpenSUSE, in case it matters) has failed to find the root filesystem, so it drops you into a rescue shell. I know perfectly well what device needs to be mounted though. My question:
What is the correct procedure to mount the root filesystem and continue the boot sequence?
Presumably that's the whole point of the rescue console. And yet, nobody seems to have documented how you actually do this.
Obviously I can mount the root filesystem somewhere. But how do I make that the root of the filesystem tree? And now do I continue the normal boot process after that? (I thought just exiting the shell would do it... but it doesn't.) What exactly do you need to get mounted before you continue, and how do you continue?
boot opensuse startup initramfs root-filesystem
boot opensuse startup initramfs root-filesystem
edited Jun 24 '16 at 18:36
Gilles
515k12210241553
515k12210241553
asked Jun 23 '16 at 14:08
MathematicalOrchid
2,22041642
2,22041642
2
I could be wrong, but I think once you're in a rescue shell you can't continue the current boot, you fix things so the next boot will succeed
â Eric Renouf
Jun 23 '16 at 14:14
@EricRenouf manually booting the full system may very well be the easiest way to fix such an issue. I had problems in the past where the initramfs failed to open my cryptsetup-luks encrypted root partition, and the easiest fix was to manually boot it and then runupdate-initramfs -u
. I absolutely couldn't get it working when I justchroot
ed into the root filesystem from a rescue system; the resulting initramfs was always broken.
â Martin von Wittich
Jun 23 '16 at 15:13
Is it actually an initrd, or an initramfs? (Just because the file is calledinitrd
doesn't mean that it's one: most distributions have switched toinitramfs
but keep calling the fileinitrd
.) What distribution are you using (as what the initrd/initramfs does depends on what the distribution put there)?
â Gilles
Jun 23 '16 at 22:40
@Gilles I'm pretty sure it's actually initramfs. Not sure if it actually makes a difference though; either way, I've got a mini filesystem and I need to mount the real filesystem. (OpenSUSE, in case it matters.)
â MathematicalOrchid
Jun 24 '16 at 7:57
add a comment |Â
2
I could be wrong, but I think once you're in a rescue shell you can't continue the current boot, you fix things so the next boot will succeed
â Eric Renouf
Jun 23 '16 at 14:14
@EricRenouf manually booting the full system may very well be the easiest way to fix such an issue. I had problems in the past where the initramfs failed to open my cryptsetup-luks encrypted root partition, and the easiest fix was to manually boot it and then runupdate-initramfs -u
. I absolutely couldn't get it working when I justchroot
ed into the root filesystem from a rescue system; the resulting initramfs was always broken.
â Martin von Wittich
Jun 23 '16 at 15:13
Is it actually an initrd, or an initramfs? (Just because the file is calledinitrd
doesn't mean that it's one: most distributions have switched toinitramfs
but keep calling the fileinitrd
.) What distribution are you using (as what the initrd/initramfs does depends on what the distribution put there)?
â Gilles
Jun 23 '16 at 22:40
@Gilles I'm pretty sure it's actually initramfs. Not sure if it actually makes a difference though; either way, I've got a mini filesystem and I need to mount the real filesystem. (OpenSUSE, in case it matters.)
â MathematicalOrchid
Jun 24 '16 at 7:57
2
2
I could be wrong, but I think once you're in a rescue shell you can't continue the current boot, you fix things so the next boot will succeed
â Eric Renouf
Jun 23 '16 at 14:14
I could be wrong, but I think once you're in a rescue shell you can't continue the current boot, you fix things so the next boot will succeed
â Eric Renouf
Jun 23 '16 at 14:14
@EricRenouf manually booting the full system may very well be the easiest way to fix such an issue. I had problems in the past where the initramfs failed to open my cryptsetup-luks encrypted root partition, and the easiest fix was to manually boot it and then run
update-initramfs -u
. I absolutely couldn't get it working when I just chroot
ed into the root filesystem from a rescue system; the resulting initramfs was always broken.â Martin von Wittich
Jun 23 '16 at 15:13
@EricRenouf manually booting the full system may very well be the easiest way to fix such an issue. I had problems in the past where the initramfs failed to open my cryptsetup-luks encrypted root partition, and the easiest fix was to manually boot it and then run
update-initramfs -u
. I absolutely couldn't get it working when I just chroot
ed into the root filesystem from a rescue system; the resulting initramfs was always broken.â Martin von Wittich
Jun 23 '16 at 15:13
Is it actually an initrd, or an initramfs? (Just because the file is called
initrd
doesn't mean that it's one: most distributions have switched to initramfs
but keep calling the file initrd
.) What distribution are you using (as what the initrd/initramfs does depends on what the distribution put there)?â Gilles
Jun 23 '16 at 22:40
Is it actually an initrd, or an initramfs? (Just because the file is called
initrd
doesn't mean that it's one: most distributions have switched to initramfs
but keep calling the file initrd
.) What distribution are you using (as what the initrd/initramfs does depends on what the distribution put there)?â Gilles
Jun 23 '16 at 22:40
@Gilles I'm pretty sure it's actually initramfs. Not sure if it actually makes a difference though; either way, I've got a mini filesystem and I need to mount the real filesystem. (OpenSUSE, in case it matters.)
â MathematicalOrchid
Jun 24 '16 at 7:57
@Gilles I'm pretty sure it's actually initramfs. Not sure if it actually makes a difference though; either way, I've got a mini filesystem and I need to mount the real filesystem. (OpenSUSE, in case it matters.)
â MathematicalOrchid
Jun 24 '16 at 7:57
add a comment |Â
5 Answers
5
active
oldest
votes
up vote
3
down vote
Simply run fsck
command without options from initramfs
then reboot
eg: the root partition is sda3
fsck /dev/sda3
add a comment |Â
up vote
2
down vote
normal procedure is
- mount /dev/sdX /mnt
- fix problem on /mnt
- reboot
You might want to
- mount /dev/sdX /mnt
- fix /mnt
- umount /mnt
- mount /dev/sdX /
- finish boot manualy
This is not recommended, you'll have to do it on every boot.
In a production environment, you can't be sure manual boot follow same steps as automatic one.
However in a emergency with critical data, step 5 usualy boil down to:
- 5.1 set up network
- 5.2 copy important file to safe place
1
I believe the "actual" question of the original poster was "How exactly do you do '5. finish boot manualy'?"
â user2121874
Dec 3 '17 at 19:59
add a comment |Â
up vote
2
down vote
exec switch_root /mnt/root /sbin/init
https://wiki.gentoo.org/wiki/Custom_Initramfs#Init
add a comment |Â
up vote
1
down vote
If the root=
parameter is correct and the issue is just that the necessary device isn't available (for example because the initramfs failed to assemble an md
RAID), then it's enough to make the device available manually, for example:
mdadm --assemble ...
Then check that the device is there and if everything looks good, hit ctrl + d or type exit
to quit the initramfs shell. The initramfs will then mount the root filesystem and continue to boot as usual. After the system has booted, you should then repair the underlying issue, for example by running update-initramfs -u
.
I haven't yet found a way to tell the initramfs to boot a different device than what /proc/cmdline
says. Maybe someone else has an idea?
add a comment |Â
up vote
0
down vote
GAD3R posted:
Simply run fsck command without options from initramfs then reboot
eg: the root partition is sda3
fsck /dev/sda3
worked on Debian Buster/sid 64
I wanted dualboot Debian and Ubuntu. To install Ubuntu I had to shrink Debian's partition and whole installation went fine but could not boot to Debian.
Using Debian's Rescue Mode from GRUB I ended up in initramfs prompt. Running the above command asked only 3x if I want fix this and that problem pressing "Yes" or just "y" and rebooting fixed it.
Since I have still low reputation I can't just add comment to someone's post so have to do it this way.
Sharing is caring..
New contributor
add a comment |Â
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Simply run fsck
command without options from initramfs
then reboot
eg: the root partition is sda3
fsck /dev/sda3
add a comment |Â
up vote
3
down vote
Simply run fsck
command without options from initramfs
then reboot
eg: the root partition is sda3
fsck /dev/sda3
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Simply run fsck
command without options from initramfs
then reboot
eg: the root partition is sda3
fsck /dev/sda3
Simply run fsck
command without options from initramfs
then reboot
eg: the root partition is sda3
fsck /dev/sda3
answered Feb 7 '17 at 8:31
GAD3R
23.6k164899
23.6k164899
add a comment |Â
add a comment |Â
up vote
2
down vote
normal procedure is
- mount /dev/sdX /mnt
- fix problem on /mnt
- reboot
You might want to
- mount /dev/sdX /mnt
- fix /mnt
- umount /mnt
- mount /dev/sdX /
- finish boot manualy
This is not recommended, you'll have to do it on every boot.
In a production environment, you can't be sure manual boot follow same steps as automatic one.
However in a emergency with critical data, step 5 usualy boil down to:
- 5.1 set up network
- 5.2 copy important file to safe place
1
I believe the "actual" question of the original poster was "How exactly do you do '5. finish boot manualy'?"
â user2121874
Dec 3 '17 at 19:59
add a comment |Â
up vote
2
down vote
normal procedure is
- mount /dev/sdX /mnt
- fix problem on /mnt
- reboot
You might want to
- mount /dev/sdX /mnt
- fix /mnt
- umount /mnt
- mount /dev/sdX /
- finish boot manualy
This is not recommended, you'll have to do it on every boot.
In a production environment, you can't be sure manual boot follow same steps as automatic one.
However in a emergency with critical data, step 5 usualy boil down to:
- 5.1 set up network
- 5.2 copy important file to safe place
1
I believe the "actual" question of the original poster was "How exactly do you do '5. finish boot manualy'?"
â user2121874
Dec 3 '17 at 19:59
add a comment |Â
up vote
2
down vote
up vote
2
down vote
normal procedure is
- mount /dev/sdX /mnt
- fix problem on /mnt
- reboot
You might want to
- mount /dev/sdX /mnt
- fix /mnt
- umount /mnt
- mount /dev/sdX /
- finish boot manualy
This is not recommended, you'll have to do it on every boot.
In a production environment, you can't be sure manual boot follow same steps as automatic one.
However in a emergency with critical data, step 5 usualy boil down to:
- 5.1 set up network
- 5.2 copy important file to safe place
normal procedure is
- mount /dev/sdX /mnt
- fix problem on /mnt
- reboot
You might want to
- mount /dev/sdX /mnt
- fix /mnt
- umount /mnt
- mount /dev/sdX /
- finish boot manualy
This is not recommended, you'll have to do it on every boot.
In a production environment, you can't be sure manual boot follow same steps as automatic one.
However in a emergency with critical data, step 5 usualy boil down to:
- 5.1 set up network
- 5.2 copy important file to safe place
answered Jun 23 '16 at 15:06
Archemar
19.2k93468
19.2k93468
1
I believe the "actual" question of the original poster was "How exactly do you do '5. finish boot manualy'?"
â user2121874
Dec 3 '17 at 19:59
add a comment |Â
1
I believe the "actual" question of the original poster was "How exactly do you do '5. finish boot manualy'?"
â user2121874
Dec 3 '17 at 19:59
1
1
I believe the "actual" question of the original poster was "How exactly do you do '5. finish boot manualy'?"
â user2121874
Dec 3 '17 at 19:59
I believe the "actual" question of the original poster was "How exactly do you do '5. finish boot manualy'?"
â user2121874
Dec 3 '17 at 19:59
add a comment |Â
up vote
2
down vote
exec switch_root /mnt/root /sbin/init
https://wiki.gentoo.org/wiki/Custom_Initramfs#Init
add a comment |Â
up vote
2
down vote
exec switch_root /mnt/root /sbin/init
https://wiki.gentoo.org/wiki/Custom_Initramfs#Init
add a comment |Â
up vote
2
down vote
up vote
2
down vote
exec switch_root /mnt/root /sbin/init
https://wiki.gentoo.org/wiki/Custom_Initramfs#Init
exec switch_root /mnt/root /sbin/init
https://wiki.gentoo.org/wiki/Custom_Initramfs#Init
answered Nov 21 '17 at 8:01
Petr Ketner
211
211
add a comment |Â
add a comment |Â
up vote
1
down vote
If the root=
parameter is correct and the issue is just that the necessary device isn't available (for example because the initramfs failed to assemble an md
RAID), then it's enough to make the device available manually, for example:
mdadm --assemble ...
Then check that the device is there and if everything looks good, hit ctrl + d or type exit
to quit the initramfs shell. The initramfs will then mount the root filesystem and continue to boot as usual. After the system has booted, you should then repair the underlying issue, for example by running update-initramfs -u
.
I haven't yet found a way to tell the initramfs to boot a different device than what /proc/cmdline
says. Maybe someone else has an idea?
add a comment |Â
up vote
1
down vote
If the root=
parameter is correct and the issue is just that the necessary device isn't available (for example because the initramfs failed to assemble an md
RAID), then it's enough to make the device available manually, for example:
mdadm --assemble ...
Then check that the device is there and if everything looks good, hit ctrl + d or type exit
to quit the initramfs shell. The initramfs will then mount the root filesystem and continue to boot as usual. After the system has booted, you should then repair the underlying issue, for example by running update-initramfs -u
.
I haven't yet found a way to tell the initramfs to boot a different device than what /proc/cmdline
says. Maybe someone else has an idea?
add a comment |Â
up vote
1
down vote
up vote
1
down vote
If the root=
parameter is correct and the issue is just that the necessary device isn't available (for example because the initramfs failed to assemble an md
RAID), then it's enough to make the device available manually, for example:
mdadm --assemble ...
Then check that the device is there and if everything looks good, hit ctrl + d or type exit
to quit the initramfs shell. The initramfs will then mount the root filesystem and continue to boot as usual. After the system has booted, you should then repair the underlying issue, for example by running update-initramfs -u
.
I haven't yet found a way to tell the initramfs to boot a different device than what /proc/cmdline
says. Maybe someone else has an idea?
If the root=
parameter is correct and the issue is just that the necessary device isn't available (for example because the initramfs failed to assemble an md
RAID), then it's enough to make the device available manually, for example:
mdadm --assemble ...
Then check that the device is there and if everything looks good, hit ctrl + d or type exit
to quit the initramfs shell. The initramfs will then mount the root filesystem and continue to boot as usual. After the system has booted, you should then repair the underlying issue, for example by running update-initramfs -u
.
I haven't yet found a way to tell the initramfs to boot a different device than what /proc/cmdline
says. Maybe someone else has an idea?
answered Jun 24 '16 at 11:56
Martin von Wittich
9,69433157
9,69433157
add a comment |Â
add a comment |Â
up vote
0
down vote
GAD3R posted:
Simply run fsck command without options from initramfs then reboot
eg: the root partition is sda3
fsck /dev/sda3
worked on Debian Buster/sid 64
I wanted dualboot Debian and Ubuntu. To install Ubuntu I had to shrink Debian's partition and whole installation went fine but could not boot to Debian.
Using Debian's Rescue Mode from GRUB I ended up in initramfs prompt. Running the above command asked only 3x if I want fix this and that problem pressing "Yes" or just "y" and rebooting fixed it.
Since I have still low reputation I can't just add comment to someone's post so have to do it this way.
Sharing is caring..
New contributor
add a comment |Â
up vote
0
down vote
GAD3R posted:
Simply run fsck command without options from initramfs then reboot
eg: the root partition is sda3
fsck /dev/sda3
worked on Debian Buster/sid 64
I wanted dualboot Debian and Ubuntu. To install Ubuntu I had to shrink Debian's partition and whole installation went fine but could not boot to Debian.
Using Debian's Rescue Mode from GRUB I ended up in initramfs prompt. Running the above command asked only 3x if I want fix this and that problem pressing "Yes" or just "y" and rebooting fixed it.
Since I have still low reputation I can't just add comment to someone's post so have to do it this way.
Sharing is caring..
New contributor
add a comment |Â
up vote
0
down vote
up vote
0
down vote
GAD3R posted:
Simply run fsck command without options from initramfs then reboot
eg: the root partition is sda3
fsck /dev/sda3
worked on Debian Buster/sid 64
I wanted dualboot Debian and Ubuntu. To install Ubuntu I had to shrink Debian's partition and whole installation went fine but could not boot to Debian.
Using Debian's Rescue Mode from GRUB I ended up in initramfs prompt. Running the above command asked only 3x if I want fix this and that problem pressing "Yes" or just "y" and rebooting fixed it.
Since I have still low reputation I can't just add comment to someone's post so have to do it this way.
Sharing is caring..
New contributor
GAD3R posted:
Simply run fsck command without options from initramfs then reboot
eg: the root partition is sda3
fsck /dev/sda3
worked on Debian Buster/sid 64
I wanted dualboot Debian and Ubuntu. To install Ubuntu I had to shrink Debian's partition and whole installation went fine but could not boot to Debian.
Using Debian's Rescue Mode from GRUB I ended up in initramfs prompt. Running the above command asked only 3x if I want fix this and that problem pressing "Yes" or just "y" and rebooting fixed it.
Since I have still low reputation I can't just add comment to someone's post so have to do it this way.
Sharing is caring..
New contributor
New contributor
answered 5 mins ago
Vlad
1
1
New contributor
New contributor
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f291638%2fmount-root-filesystem-from-initramfs%23new-answer', 'question_page');
);
Post as a guest
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
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
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
2
I could be wrong, but I think once you're in a rescue shell you can't continue the current boot, you fix things so the next boot will succeed
â Eric Renouf
Jun 23 '16 at 14:14
@EricRenouf manually booting the full system may very well be the easiest way to fix such an issue. I had problems in the past where the initramfs failed to open my cryptsetup-luks encrypted root partition, and the easiest fix was to manually boot it and then run
update-initramfs -u
. I absolutely couldn't get it working when I justchroot
ed into the root filesystem from a rescue system; the resulting initramfs was always broken.â Martin von Wittich
Jun 23 '16 at 15:13
Is it actually an initrd, or an initramfs? (Just because the file is called
initrd
doesn't mean that it's one: most distributions have switched toinitramfs
but keep calling the fileinitrd
.) What distribution are you using (as what the initrd/initramfs does depends on what the distribution put there)?â Gilles
Jun 23 '16 at 22:40
@Gilles I'm pretty sure it's actually initramfs. Not sure if it actually makes a difference though; either way, I've got a mini filesystem and I need to mount the real filesystem. (OpenSUSE, in case it matters.)
â MathematicalOrchid
Jun 24 '16 at 7:57