Don't understand german? Read or subscribe to my english-only feed.

Use root=UUID on NSLU2

As I wrote a few monce ago I’m owner of a NSLU2 device powered by Debian. Now I had to install another device (using di-nslu2-etch-4.0r0.bin – md5: db8e8ec3571aff8fb2132479f860f16b this time) and I wanted to change the setup from using /dev/sda2 to a UUID based one – to get a stable root device.

Nothing really tricky (thanks to the existing documentation) but just as a reference (for myself and other users considering the switch as well) the relevant steps…

First of all identify the root-device (/dev/sda2 in my case) and get its UUID:

# /lib/udev/vol_id -u /dev/sda2
a98ebb0f-84ae-4f7a-a070-b94ecee3f94a

Make sure initramfs-tools use the given UUID as ROOT-option:

# echo "ROOT=/dev/disk/by-uuid/a98ebb0f-84ae-4f7a-a070-b94ecee3f94a" > \\
/etc/initramfs-tools/conf.d/root-device-hack
# update-initramfs -k all -u

Replace the /dev/sda2 line in your /etc/fstab with:

/dev/disk/by-uuid/a98ebb0f-84ae-4f7a-a070-b94ecee3f94a /               ext3    defaults,errors=remount-ro 0       1

Make a backup of the original mtdblock2 and install the one Martin Michlmayr thankfully provides:

# cat /dev/mtdblock* > mtdblock.backup
# cat /dev/mtdblock2 > mtdblock2.original

# wget http://www.cyrius.com/debian/nslu2/files/etch-modified-mtdblock2.bin
# md5sum etch-modified-mtdblock2.bin
e5154ceed8ad7de5bca83cc98fbb4d79  etch-modified-mtdblock2.bin
# cat etch-modified-mtdblock2.bin > /dev/mtdblock2
# apex-env printenv
... compare output with http://www.nslu2-linux.org/wiki/Debian/ChangeKernelCommandLine

Finally set the new kernel commandline:

apex-env setenv cmdline 'console=ttyS0,115200 rtc-x1205.probe=0,0x6f noirqdebug rootdelay=10 root=UUID=a98ebb0f-84ae-4f7a-a070-b94ecee3f94a'

That’s it. Now after rebooting your system should use the UUID-approach instead of /dev/sd*. Check via:

# cat /proc/cmdline
console=ttyS0,115200 rtc-x1205.probe=0,0x6f noirqdebug rootdelay=10 \\
root=UUID=a98ebb0f-84ae-4f7a-a070-b94ecee3f94a

Ressources:

Comments are closed.