You are not logged in.
Pages: 1
Topic closed
I'm trying to move / from btrfs partition into other ext4 partition placed on same raid0 disk (yeah my kernel is compiled with dmraid and btrfs hooks + /boot [ext2] is placed on other disk) and after:
- doing cp -rp /* from btrfs to ext4 with livecd;
- editing grub/menu.lst;
- editing etc/fstab and etc/mtab (just in case ;P) of ext4 part;
- rebooting;
im getting error:
mount: mounting /dev/disk/by-uuid/<ext4-partition-uuid> on /new_root failed: No such device
Failed to mount real root device.
and then it's sending me into [ramfs #] console, where after doing `ls /dev/disk/by-uuid/` i can see that <ext4-partition-uuid> exists...
I remember i saw such error earlier when i was moving / from one disk into the one im using now (raid0), from btrfs to btrfs, and then i put `dmraid` into mkinitcpio hooks and it was fixed, but now i dunno what to do...
Last edited by Vi0L0 (2011-10-16 16:06:18)
Offline
'No such device' is very different from 'No such file or directory'. In particular, mount(2) states that ENODEV is returned when the filesystem isn't recognized. Sounds like you forgot to add 'ext4' to MODULES or 'filesystems' to HOOKS in your mkinitcpio.conf.
Offline
Yeah, i also thought that there's some problem with ext4 recognition, but both mentioned by you entries were and are present.
BTW fallback kernel spits same error message
Offline
Offline
wow, i thought same thing, and just did that
and yeah - i can `modprobe btrfs` but not `modprobe ext4` in ramfs, i will create some additional ext4 hook and then check.
Guess i will win with this now, if yes - i will mark this as solved, if not -continue
Thank you Sir falconindy
Edit: SOLVED by creating additional ext4 hook (still i don't know why filesystems hook did not work), more details:
- basing on `btrfs` hook i created 2 files:
$ cat /lib/initcpio/install/ext4
#!/bin/bash
build() {
MODULES="$(all_modules ext4)"
}
help() {
cat <<HELPEOF
This hook is needed to support ext4 volumes spread over multiple devices.
HELPEOF
}
$ cat /lib/initcpio/hooks/ext4
# vim: set ft=sh:
run_hook ()
{
modprobe ext4
}
Last edited by Vi0L0 (2011-10-16 16:05:54)
Offline
Offline
Sorry i'm busy that's why i was happy with workaround, but i can look at it if you would like to help me...
Umm... ok so i checked it from where i am now - / partition on ext4, no btrfs partition mounted, no `btrfs` in mkinitcpio.conf, although i `modprobe btrfs`, let's look at the created initramfs file: `bsdtar -x -f initramfs-linux.img` + `grep -r` for btrfs - no kernel module.
Let's add `btrfs` into mkinitcpio.conf - same unpacking and greping - btrfs module is there
At the beginig i was wrong - i was using / partition on btrfs without `btrfs` mkinitcpio.conf and it was working fine...
But ok before making any conclusion, let me switch into older / on btrfs and see what's initramfs is it creating... BRB
Offline
Offline
I was under the impression that you were moving away from btrfs... wouldn't ext4 be the more appropriate thing to be looking for the initramfs?
i firstly grep for ext4, but it was there no matter if ext4 hook was or wasn't in mkinitcpio.conf...
Anyway i now switched to / on btrfs and did create initramfs without my ext4 hook (also without btrfs hook) - btrfs is present, ext4 is not.
I got ext4 in MODULES=, and ext4 partitions mounted (ie. my /home was and is on ext4)
Conclusion: looks like without additional hook mkinitcpio is not adding fs modules that it should to add - i mean i though that it should to add ext4 if ext4 module is loaded and used, but now - even if filesystems hook is present - it's not doing such thing.
I don't know is that intentional, but if i will look at it from the btrfs-to-ext4-switcher point of view it does look like a bug.
FYI: there's `lsinitcpio' for poking around images.
thanks, will check that later
Last edited by Vi0L0 (2011-10-16 18:58:02)
Offline
Offline
aaah... i rly missunderstood
first of all - my ext4 was in MODULES, but in rc.conf, not mkinitcpio.conf, ooops! sorry!
i'm kinda tired today...
but anyway doesn't `filesystems` in HOOKS serve such simple thing like adding all loaded fs modules into initramfs?
EDIT: in mkinitcpio.conf's comments i found:
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
so i guess it should to add this ext4 module into initramfs even if ext4 is not in mkinitcpio.conf's MODULES or am i rly rly missing something?
BTW: from / on btrfs here's my:
- /etc/mkinitcpio.conf:
MODULES=""
BINARIES=""
FILES=""
HOOKS="base udev autodetect pata scsi sata dmraid filesystems usbinput consolefont"
- lsinitcpio initramfs-linux.img: http://hpaste.org/52699
+
# lsmod | grep ext
ext2 61004 1
ext4 257609 1
mbcache 5521 2 ext2,ext4
jbd2 52164 1 ext4
crc16 1257 1 ext4
Last edited by Vi0L0 (2011-10-16 19:25:45)
Offline
The image that boots the btrfs root is not at all interesting to me. It works.
Where is lsmod coming from? Surely that's after you've booted, which is completely irrelevant to the situation.
I maintain that the problem is that the ext4 modules do not exist on the initramfs you're creating.
Offline
The image that boots the btrfs root is not at all interesting to me. It works.
Where is lsmod coming from? Surely that's after you've booted, which is completely irrelevant to the situation.
I should be more specific, yes it comes from booted system. And as i told before - i can not list ext4 in [ramfs #].
But why i put it here is that i want to know:
anyway doesn't `filesystems` in HOOKS serve such simple thing like adding all loaded fs modules into initramfs?
EDIT: in mkinitcpio.conf's comments i found:# 'filesystems' is _required_ unless you specify your fs modules in MODULES
so i guess it should to add this ext4 module into initramfs even if ext4 is not in mkinitcpio.conf's MODULES or am i rly rly missing something?
Looks like even you, falconindy, thought that `filesystems` hook should to work:
Sounds like you forgot to add 'ext4' to MODULES or 'filesystems' to HOOKS in your mkinitcpio.conf.
If it's able to add only 1 filesystem - then why is it called `filesystems`?
I maintain that the problem is that the ext4 modules do not exist on the initramfs you're creating.
Yes, indeed. If i will add it to mkinitcpio's MODULES then there's no problem.
Anyway i think that we can close this topic.
Offline
If it's able to add only 1 filesystem - then why is it called `filesystems`?
Because you're looking at it in the context of the autodetect hook, which will prune all filesystems down to the one used by the current root device. There's no way of telling mkinitcpio that your root isn't really the current root other than by explicitly providing the module for the FS. If you were to boot onto the ext4 root and recreate the initramfs with the autodetect and filesystems hook, it would correctly add ext4 instead of btrfs.
Offline
Ok. And yes - it is correctly adding ext4 instead of btrfs.
Thank you falconindy one more time. You teached me a lot of new things, good luck Sir
Last edited by Vi0L0 (2011-10-16 22:18:15)
Offline
what I made:
- saved root files with cp -aRv to a temporary location
- inserted the archlinux install usb drive
- created a new ext4 partition to be the new root
- copied the old files to the new ext4 partition
- mounted the partitions and swaps
- generated new fstab since its a new root and UUID (genfstab -U)
- chrooted
- grub-mkconfig -o /boot/grub/grub.cfg
- mkinitcpio - p linux
I think that was all. Hope not to messed up with files permissions.
Offline
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Pages: 1
Topic closed