You are not logged in.
I am writing my hook for `initcpio` (`initramfs`). As I see, the scripts in `initramfs` are executed by the `ash` shell. While testing my scripts on a booted ArchLinux, I stumbled upon a strange difference between `ash` and `bash`.
test2
#!/usr/bin/ash
DEV=/dev/disk/by-partlabel/TEST
mount "$DEV" /root/mnt/temp
umount "$DEV"
Executing the above script outputs
root@>./test2
[37511.101479] F2FS-fs (sda5): Can't find valid F2FS filesystem in 1th superblock
[37511.103303] F2FS-fs (sda5): Can't find valid F2FS filesystem in 2th superblock
umount: can't unmount /dev/disk/by-partlabel/TEST: Invalid argument
I suppose that the F2FS messages are from the kernel. Nevertheless, the partition gets mounted. It does not get unmounted.
If I replace `ash` with `bash`, I see no error. I don't understand what is wrong with my command and why replacing `ash` with `bash` fixes the error. Obviously, I can't use `bash` in a real `initramfs`.
ls -l -d /root/mnt/temp
drwxr-xr-x 2 root root 4096 Apr 28 2016 /root/mnt/temp
ls -l /dev/disk/by-partlabel/TEST
lrwxrwxrwx 1 root root 10 Mar 3 14:46 /dev/disk/by-partlabel/TEST -> ../../sda5
we are not condemned to write ugly code
Offline
umount /root/mnt/temp
Offline
ash is busybox, "mount" and "umount" are built-ins, not /usr/bin/u|mount - try the full paths.
Online