How can I change the UUID of my nixos OS partition, and update the bootloader?
up vote
1
down vote
favorite
So essentially I've got an exact clone of my partition (I've changed the UUID though), and I'd now like to change over the bootloader to load the new partition.
What I tried:
I naively (while booted / running on the original partition) tried to modify the hardware-configuration.nix
(on the original partition) with the new UUID
and then tried to:
sudo nixos-rebuild switch
sudo nixos-rebuild boot
Both which fails** at the point of mounting the drives (I think).
updating GRUB 2 menu...
lsblk: /dev/mapper/no*[0-9]: not a block device
lsblk: /dev/mapper/raid*[0-9]: not a block device
lsblk: /dev/mapper/disks*[0-9]: not a block device
Found Arch Linux on /dev/sdb3
Also, I'd assume I'd possibly need to mount this new partition somewhere (unless, this isn't required to actually boot into it (after a reboot)?).
** Actually although it appears to 'fail', when I reboot, and select the usual nixos grub entry, I see the following (the UUID mentioned is the UUID that does exist - and it's the new partition):
Worst case scenario, it seems I'd be able to use a nixos live USB to mount the new partition to /mnt
and then just follow the usual nixos-install
(which has worked in the past - with only the /etc/nixos directory present though)?
nix nixos
add a comment |
up vote
1
down vote
favorite
So essentially I've got an exact clone of my partition (I've changed the UUID though), and I'd now like to change over the bootloader to load the new partition.
What I tried:
I naively (while booted / running on the original partition) tried to modify the hardware-configuration.nix
(on the original partition) with the new UUID
and then tried to:
sudo nixos-rebuild switch
sudo nixos-rebuild boot
Both which fails** at the point of mounting the drives (I think).
updating GRUB 2 menu...
lsblk: /dev/mapper/no*[0-9]: not a block device
lsblk: /dev/mapper/raid*[0-9]: not a block device
lsblk: /dev/mapper/disks*[0-9]: not a block device
Found Arch Linux on /dev/sdb3
Also, I'd assume I'd possibly need to mount this new partition somewhere (unless, this isn't required to actually boot into it (after a reboot)?).
** Actually although it appears to 'fail', when I reboot, and select the usual nixos grub entry, I see the following (the UUID mentioned is the UUID that does exist - and it's the new partition):
Worst case scenario, it seems I'd be able to use a nixos live USB to mount the new partition to /mnt
and then just follow the usual nixos-install
(which has worked in the past - with only the /etc/nixos directory present though)?
nix nixos
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
So essentially I've got an exact clone of my partition (I've changed the UUID though), and I'd now like to change over the bootloader to load the new partition.
What I tried:
I naively (while booted / running on the original partition) tried to modify the hardware-configuration.nix
(on the original partition) with the new UUID
and then tried to:
sudo nixos-rebuild switch
sudo nixos-rebuild boot
Both which fails** at the point of mounting the drives (I think).
updating GRUB 2 menu...
lsblk: /dev/mapper/no*[0-9]: not a block device
lsblk: /dev/mapper/raid*[0-9]: not a block device
lsblk: /dev/mapper/disks*[0-9]: not a block device
Found Arch Linux on /dev/sdb3
Also, I'd assume I'd possibly need to mount this new partition somewhere (unless, this isn't required to actually boot into it (after a reboot)?).
** Actually although it appears to 'fail', when I reboot, and select the usual nixos grub entry, I see the following (the UUID mentioned is the UUID that does exist - and it's the new partition):
Worst case scenario, it seems I'd be able to use a nixos live USB to mount the new partition to /mnt
and then just follow the usual nixos-install
(which has worked in the past - with only the /etc/nixos directory present though)?
nix nixos
So essentially I've got an exact clone of my partition (I've changed the UUID though), and I'd now like to change over the bootloader to load the new partition.
What I tried:
I naively (while booted / running on the original partition) tried to modify the hardware-configuration.nix
(on the original partition) with the new UUID
and then tried to:
sudo nixos-rebuild switch
sudo nixos-rebuild boot
Both which fails** at the point of mounting the drives (I think).
updating GRUB 2 menu...
lsblk: /dev/mapper/no*[0-9]: not a block device
lsblk: /dev/mapper/raid*[0-9]: not a block device
lsblk: /dev/mapper/disks*[0-9]: not a block device
Found Arch Linux on /dev/sdb3
Also, I'd assume I'd possibly need to mount this new partition somewhere (unless, this isn't required to actually boot into it (after a reboot)?).
** Actually although it appears to 'fail', when I reboot, and select the usual nixos grub entry, I see the following (the UUID mentioned is the UUID that does exist - and it's the new partition):
Worst case scenario, it seems I'd be able to use a nixos live USB to mount the new partition to /mnt
and then just follow the usual nixos-install
(which has worked in the past - with only the /etc/nixos directory present though)?
nix nixos
nix nixos
edited Nov 22 at 14:59
asked Nov 21 at 22:34
Chris Stryczynski
3,42732654
3,42732654
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
Firstly, get the system in working order again by changing the UUID back in hardware-configuration.nix
and making sure it boots OK.
Next, change the UUID in hardware-configuration.nix
, like you have done before, but this time run sudo nixos-rebuild boot
.
When you reboot you'll have a new entry in your systemd-boot or GRUB2 menu. The new entry will boot NixOS from the new partition.
I've updated the question with the error message, thenixos-rebuild boot
seems to run into the same error.
– Chris Stryczynski
Nov 22 at 14:40
add a comment |
up vote
0
down vote
I tried using the nixos-install
route.
I had issues with my existing hardware-configuration.nix it seems as I ran into the exact same issue waiting for device...
.
Finally I ran nixos-generate-config --root /mnt
which generated a new config which had the following differences:
diff -u nixos.backup/hardware-configuration.nix /etc/nixos/hardware-configuration.nix
--- nixos.backup/hardware-configuration.nix 2018-11-22 20:18:01.361647120 +0000
+++ /etc/nixos/hardware-configuration.nix 2018-11-22 20:18:41.818644420 +0000
@@ -8,8 +8,8 @@
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
- boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
- boot.kernelModules = [ "kvm-intel" ];
+ boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
+ boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
@@ -20,6 +20,4 @@
swapDevices = [ ];
nix.maxJobs = lib.mkDefault 4;
- powerManagement.cpuFreqGovernor = "powersave";
}
-
So probably the nvme
bit. Also add that I had kvm-intel
as my CPU stayed the same (which is an AMD).
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Firstly, get the system in working order again by changing the UUID back in hardware-configuration.nix
and making sure it boots OK.
Next, change the UUID in hardware-configuration.nix
, like you have done before, but this time run sudo nixos-rebuild boot
.
When you reboot you'll have a new entry in your systemd-boot or GRUB2 menu. The new entry will boot NixOS from the new partition.
I've updated the question with the error message, thenixos-rebuild boot
seems to run into the same error.
– Chris Stryczynski
Nov 22 at 14:40
add a comment |
up vote
2
down vote
accepted
Firstly, get the system in working order again by changing the UUID back in hardware-configuration.nix
and making sure it boots OK.
Next, change the UUID in hardware-configuration.nix
, like you have done before, but this time run sudo nixos-rebuild boot
.
When you reboot you'll have a new entry in your systemd-boot or GRUB2 menu. The new entry will boot NixOS from the new partition.
I've updated the question with the error message, thenixos-rebuild boot
seems to run into the same error.
– Chris Stryczynski
Nov 22 at 14:40
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Firstly, get the system in working order again by changing the UUID back in hardware-configuration.nix
and making sure it boots OK.
Next, change the UUID in hardware-configuration.nix
, like you have done before, but this time run sudo nixos-rebuild boot
.
When you reboot you'll have a new entry in your systemd-boot or GRUB2 menu. The new entry will boot NixOS from the new partition.
Firstly, get the system in working order again by changing the UUID back in hardware-configuration.nix
and making sure it boots OK.
Next, change the UUID in hardware-configuration.nix
, like you have done before, but this time run sudo nixos-rebuild boot
.
When you reboot you'll have a new entry in your systemd-boot or GRUB2 menu. The new entry will boot NixOS from the new partition.
answered Nov 22 at 10:14
Emmanuel Rosa
8,2312618
8,2312618
I've updated the question with the error message, thenixos-rebuild boot
seems to run into the same error.
– Chris Stryczynski
Nov 22 at 14:40
add a comment |
I've updated the question with the error message, thenixos-rebuild boot
seems to run into the same error.
– Chris Stryczynski
Nov 22 at 14:40
I've updated the question with the error message, the
nixos-rebuild boot
seems to run into the same error.– Chris Stryczynski
Nov 22 at 14:40
I've updated the question with the error message, the
nixos-rebuild boot
seems to run into the same error.– Chris Stryczynski
Nov 22 at 14:40
add a comment |
up vote
0
down vote
I tried using the nixos-install
route.
I had issues with my existing hardware-configuration.nix it seems as I ran into the exact same issue waiting for device...
.
Finally I ran nixos-generate-config --root /mnt
which generated a new config which had the following differences:
diff -u nixos.backup/hardware-configuration.nix /etc/nixos/hardware-configuration.nix
--- nixos.backup/hardware-configuration.nix 2018-11-22 20:18:01.361647120 +0000
+++ /etc/nixos/hardware-configuration.nix 2018-11-22 20:18:41.818644420 +0000
@@ -8,8 +8,8 @@
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
- boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
- boot.kernelModules = [ "kvm-intel" ];
+ boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
+ boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
@@ -20,6 +20,4 @@
swapDevices = [ ];
nix.maxJobs = lib.mkDefault 4;
- powerManagement.cpuFreqGovernor = "powersave";
}
-
So probably the nvme
bit. Also add that I had kvm-intel
as my CPU stayed the same (which is an AMD).
add a comment |
up vote
0
down vote
I tried using the nixos-install
route.
I had issues with my existing hardware-configuration.nix it seems as I ran into the exact same issue waiting for device...
.
Finally I ran nixos-generate-config --root /mnt
which generated a new config which had the following differences:
diff -u nixos.backup/hardware-configuration.nix /etc/nixos/hardware-configuration.nix
--- nixos.backup/hardware-configuration.nix 2018-11-22 20:18:01.361647120 +0000
+++ /etc/nixos/hardware-configuration.nix 2018-11-22 20:18:41.818644420 +0000
@@ -8,8 +8,8 @@
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
- boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
- boot.kernelModules = [ "kvm-intel" ];
+ boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
+ boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
@@ -20,6 +20,4 @@
swapDevices = [ ];
nix.maxJobs = lib.mkDefault 4;
- powerManagement.cpuFreqGovernor = "powersave";
}
-
So probably the nvme
bit. Also add that I had kvm-intel
as my CPU stayed the same (which is an AMD).
add a comment |
up vote
0
down vote
up vote
0
down vote
I tried using the nixos-install
route.
I had issues with my existing hardware-configuration.nix it seems as I ran into the exact same issue waiting for device...
.
Finally I ran nixos-generate-config --root /mnt
which generated a new config which had the following differences:
diff -u nixos.backup/hardware-configuration.nix /etc/nixos/hardware-configuration.nix
--- nixos.backup/hardware-configuration.nix 2018-11-22 20:18:01.361647120 +0000
+++ /etc/nixos/hardware-configuration.nix 2018-11-22 20:18:41.818644420 +0000
@@ -8,8 +8,8 @@
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
- boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
- boot.kernelModules = [ "kvm-intel" ];
+ boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
+ boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
@@ -20,6 +20,4 @@
swapDevices = [ ];
nix.maxJobs = lib.mkDefault 4;
- powerManagement.cpuFreqGovernor = "powersave";
}
-
So probably the nvme
bit. Also add that I had kvm-intel
as my CPU stayed the same (which is an AMD).
I tried using the nixos-install
route.
I had issues with my existing hardware-configuration.nix it seems as I ran into the exact same issue waiting for device...
.
Finally I ran nixos-generate-config --root /mnt
which generated a new config which had the following differences:
diff -u nixos.backup/hardware-configuration.nix /etc/nixos/hardware-configuration.nix
--- nixos.backup/hardware-configuration.nix 2018-11-22 20:18:01.361647120 +0000
+++ /etc/nixos/hardware-configuration.nix 2018-11-22 20:18:41.818644420 +0000
@@ -8,8 +8,8 @@
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
- boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
- boot.kernelModules = [ "kvm-intel" ];
+ boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
+ boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
@@ -20,6 +20,4 @@
swapDevices = [ ];
nix.maxJobs = lib.mkDefault 4;
- powerManagement.cpuFreqGovernor = "powersave";
}
-
So probably the nvme
bit. Also add that I had kvm-intel
as my CPU stayed the same (which is an AMD).
answered Nov 22 at 20:33
Chris Stryczynski
3,42732654
3,42732654
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- 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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2fstackoverflow.com%2fquestions%2f53421374%2fhow-can-i-change-the-uuid-of-my-nixos-os-partition-and-update-the-bootloader%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