cifs username changes bash username
A partition and disk imaging/cloning program
Brought to you by:
steven_shiau
I use the
ocs_prerun="mount -t cifs -o username=Everyone,password=pass //10.10.2.3/images /home/partimag"
when loading clonezilla on my pxe server, but when I run this with the latest version, it drops to a debian login box. After looking at the output, I can tell this is because it is pulling 'username=Everyone' out of my prerun and logging me in to '~Everyone/.bash_profile' which does not exist.
Yes, username is also a boot parameter for live-config. However, it is harmless. The problem is, the command "adduser" won't honor some username except you force adduser to do that with option "--force-badname". However, it seems that live-config does not support this.
A workaround for you is to use the lowercase as your username, i.e.
ocs_prerun="mount -t cifs -o username=everyone,password=pass //10.10.2.3/images /home/partimag"
Please let us know your results.
Thanks.
Steven.
I changed "everyone" to lowercase, the error still occurs.
What's your boot parameters?
Did you put "live-config" or "config" in the boot parameters, as described on:
http://clonezilla.org/downloads/stable/release-notes.php
?
Steven.
My server uses pxelinux... here's my entire boot entry from for clonezilla:
label Clonezilla
kernel /boot/clonezilla/vmlinuz1
initrd /boot/clonezilla/initrd1.img
append boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run="ocs-live-general" vga=791 fetch=tftp://10.10.2.3/boot/clonezilla/filesystem.squashfs ocs_lang="en_US.UTF-8" ocs_live_keymap="NONE" ocs_prerun="mount -t cifs -o username=everyone,password=pass //10.10.2.3/images /home/partimag" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -c -r -j2 -p true restoredisk ask_user ask_user"
How about separate the options?
i.e. make it as:
ocs_prerun="mount -t cifs -o username=everyone -o password=pass //10.10.2.3/images /home/partimag"
Steven.
Or make it like:
ocs_prerun="mount -t cifs -o user=everyone,password=pass //10.10.2.3/images /home/partimag"
Please let us know the results.
Thanks.
Steven.
I tried both of those solutions, both of them return the same error: No images found at /home/partimag
What this means is //10.10.2.3/images never actually got mounted.
ocs_prerun="mount -t cifs -o username=everyone //10.10.2.3/images /home/partimag" actually goes through, but asks me for a pssword (I just hit enter). Possibly "password=" is stopping the script?
Thanks for being so quick to respond and helping with this issue :)
Are you sure
ocs_prerun="mount -t cifs -o user=everyone,password=pass
//10.10.2.3/images /home/partimag"
is not working?
Did you replace "username" with "user"? Actually in the manual of mount.cifs, "user" is the options you can use, and it won't conflict with Debian live's boot parameter.
What's the error message shown on the screen when you use "user" instead of "username"?
Steven.
With "user=everyone" and "username=everyone", I always get "No images found at /home/partimag". I now think the comma or "password=" is the culprit. It is causing //10.10.2.3/images not to be mounted.
This is really weird. No matter Clonezilla live 1.2.6-40 or 20100113-maverick, I can use PXE to boot it and mount my CIFS server automatically by this boot parameter:
ocs_prerun="mount -t cifs -o user=adminstrator,password=pass //192.168.120.1/img /home/partimag"
Are you sure your network configuration is correct?
How about if you run the mounting command (mount -t cifs -o user=everyone,password=pass //10.10.2.3/images
/home/partimag) manually in the Clonezilla live command prompt?
Steven.
Yes, this works without any problems in command prompt:
sudo su -
mkdir /mnt/partimag
mount -t cifs -o username=everyone,password=pass //10.10.2.3/images
/home/partimag
I'm not sure if it matters, but I'm not actually running a true samba server. //10.10.2.3/images is a shared folder on a Windows 2008 R2 machine. I've never had any problems mounting that share through smb or cifs before.
So which version of Clonezilla live did you use on your PXE server?
Please post again your latest pxelinux config file so that I can try to reproduce the problem here.
BTW, my previous testing was not on a true "Samba server", it's on MS Windows XP machine.
Steven.
The version I'm using came from clonezilla-live-1.2.6-40-i486.zip
I used the stable version
label Clonezilla
kernel /boot/clonezilla/vmlinuz1
initrd /boot/clonezilla/initrd1.img
append boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run="ocs-live-general" vga=791 fetch=tftp://10.10.2.3/boot/clonezilla/filesystem.squashfs ocs_lang="en_US.UTF-8" ocs_live_keymap="NONE" ocs_prerun="mount -t cifs -o username=everyone,password=pass //10.10.2.3/images /home/partimag" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -c -r -j2 -p true restoredisk ask_user ask_user"
When ",password=pass" is removed, it works. I just have to hit ENTER on my keyboard when it asks for a password.
I tried Clonezilla live 1.2.6-40, with pxelinux config file:
kernel Clonezilla-live-vmlinuz1
append initrd=Clonezilla-live-initrd1.img boot=live live-config noswap nolocales edd=on nomodeset vga=791 fetch=tftp://192.168.120.254/Clonezilla-live-filesystem.squashfs ocs_lang="en_US.UTF-8" ocs_live_keymap="NONE" ocs_prerun="mount -t cifs -o user=administrator,password=pass //192.168.120.1/img /home/partimag" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -c -r -j2 -p true restoredisk ask_user ask_user"
=================================
It does work here. I can boot my PXE client and right directly to choose the image then restore it. You can compare this with what you have there. Remember, use "user=...", not "username=...".
Steven.
Oh wow, I removed ocs_live_run="ocs-live-general" and it started working...
Sorry for wasting so much of your time :(
No problem.
Enjoy!
Steven.
Ok, when I got to work today I had the same problem all over again. What actually happened was it worked when everyone went home and my network wasn't being used. Basically, my network sucks and there's a little lag between when the network mount registers and when clonezilla detects it. Adding 2 second sleeps around the mount fixed the problem... permanently ;P
For the sake of actually having a solution, here's my new config:
label Clonezilla
kernel /boot/clonezilla/vmlinuz1
initrd /boot/clonezilla/initrd1.img
append boot=live live-config noswap nolocales edd=on nomodeset vga=791 fetch=tftp://10.10.2.3/boot/clonezilla/filesystem.squashfs ocs_lang="en_US.UTF-8" ocs_live_keymap="NONE" ocs_prerun1="sleep 2" ocs_prerun2="mount -t cifs -o user=everyone,password=ffff //10.10.2.3/images /home/partimag" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -c -r -j2 -p true restoredisk ask_user ask_user" ocs_prerun3="sleep 2"
Sure.
So ocs_prerun* is really cool, isn't it? You can almost do whatever you want with ocs_prerun*.
:)
Steven.