[ILUG-Cochin.org] Getting error (Directory not empty) when copying file using 'cp' command to shared location (NFS) and trying to remove directory after killing copy process
Getting error (Directory not empty) when copying file using 'cp' command to shared location (NFS) and trying to remove directory after killing copy process is it NFS configuration issue ? NFS config # cat /etc/exports /home/fluent/share *(rw,sync,no_subtree_check) Using centos 6 as client Ubuntu 10.04 NFS server I also tried centos 6 as NFS server, no hope What will be the reason ? --- 1) Terminal-1 as root user # cp -ar /var/cache/cms/vm_disks/ubunu_11_server_real.disk.xm /mnt/share/IMG_u2/disk1.xm 2) Terminal-2 as root user [root@localhost ~]# ps -aux | grep cp Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ root18 0.0 0.0 0 0 ?S10:53 0:00 [cpuset] root31 0.0 0.0 0 0 ?S10:53 0:00 [kacpid] root32 0.0 0.0 0 0 ?S10:53 0:00 [kacpi_notify] root33 0.0 0.0 0 0 ?S10:53 0:00 [kacpi_hotplug] root 1660 0.0 0.0 9172 652 ?S10:53 0:00 /sbin/dhclient -d -4 -sf /usr/libexec/nm-dhcp-client.action -pf /var/run/dhclient-eth0.pid -lf /var/lib/dhclient/dhclient-5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03-eth0.lease -cf /var/run/nm-dhclient-eth0.conf eth0 root 1771 0.0 0.0 4132 516 ?Ss 10:53 0:00 /usr/sbin/acpid 681868 0.0 0.0 17860 668 ?S10:53 0:00 hald-addon-acpi: listening on acpid socket /var/run/acpid.socket root 2322 2.9 1.2 144532 26016 tty1 Ss+ 10:54 1:12 /usr/bin/Xorg :0 -nr -verbose -auth /var/run/gdm/auth-for-gdm-Ov8O8L/database -nolisten tcp vt1 nobody2335 0.0 0.0 12936 436 ?S10:54 0:00 /usr/sbin/dnsmasq --strict-order --bind-interfaces --pid-file=/var/run/libvirt/network/default.pid --conf-file= --except-interface lo --listen-address 192.168.122.1 --dhcp-range 192.168.122.2,192.168.122.254 --dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases --dhcp-lease-max=253 --dhcp-no-override root 9675 4.5 0.0 113956 1140 pts/2S+ 11:34 0:02 cp -i -ar /var/cache/cms/vm_disks/ubunu_11_server_real.disk.xm /mnt/share/IMG_u2/disk1.xm root 9772 0.0 0.0 103304 840 pts/3S+ 11:35 0:00 grep cp [root@localhost ~]# [root@localhost ~]# kill -9 9675 [root@localhost ~]# ps -aux | grep cp Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ root18 0.0 0.0 0 0 ?S10:53 0:00 [cpuset] root31 0.0 0.0 0 0 ?S10:53 0:00 [kacpid] root32 0.0 0.0 0 0 ?S10:53 0:00 [kacpi_notify] root33 0.0 0.0 0 0 ?S10:53 0:00 [kacpi_hotplug] root 1660 0.0 0.0 9172 652 ?S10:53 0:00 /sbin/dhclient -d -4 -sf /usr/libexec/nm-dhcp-client.action -pf /var/run/dhclient-eth0.pid -lf /var/lib/dhclient/dhclient-5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03-eth0.lease -cf /var/run/nm-dhclient-eth0.conf eth0 root 1771 0.0 0.0 4132 516 ?Ss 10:53 0:00 /usr/sbin/acpid 681868 0.0 0.0 17860 668 ?S10:53 0:00 hald-addon-acpi: listening on acpid socket /var/run/acpid.socket root 2322 2.8 1.2 144532 25956 tty1 Rs+ 10:54 1:13 /usr/bin/Xorg :0 -nr -verbose -auth /var/run/gdm/auth-for-gdm-Ov8O8L/database -nolisten tcp vt1 nobody2335 0.0 0.0 12936 436 ?S10:54 0:00 /usr/sbin/dnsmasq --strict-order --bind-interfaces --pid-file=/var/run/libvirt/network/default.pid --conf-file= --except-interface lo --listen-address 192.168.122.1 --dhcp-range 192.168.122.2,192.168.122.254 --dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases --dhcp-lease-max=253 --dhcp-no-override root 9675 8.5 0.0 0 0 pts/2D+ 11:34 0:06 [cp] root 9780 0.0 0.0 103304 836 pts/3S+ 11:36 0:00 grep cp [root@localhost ~]# [root@localhost ~]# rm -rf /mnt/share/IMG_u2 rm: cannot remove `/mnt/share/IMG_u2': Directory not empty [root@localhost ~]# [root@localhost ~]# [root@localhost ~]# ps -aux | grep cp Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ root18 0.0 0.0 0 0 ?S10:53 0:00 [cpuset] root31 0.0 0.0 0 0 ?S10:53 0:00 [kacpid] root32 0.0 0.0 0 0 ?S10:53 0:00 [kacpi_notify] root33 0.0 0.0 0 0 ?S10:53 0:00 [kacpi_hotplug] root 1660 0.0 0.0 9172 652 ?S10:53 0:00 /sbin/dhclient -d -4 -sf /usr/libexec/nm-dhcp-client.action -pf /var/run/dhclient-eth0.pid -lf /var/lib/dhclient/dhclient-5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03-eth0.lease -cf /var/run/nm-dhclient-eth0.conf eth0 root 1771 0.0 0.0 4132 516 ?Ss 10:53 0:00 /usr/sbin/acpid 681868 0.0 0.0 17860 668 ?S10:53 0:00 hald-addon-acpi: listening on acpid socket /var/run/acpid.socket roo
Re: [ILUG-Cochin.org] Getting error (Directory not empty) when copying file using 'cp' command to shared location (NFS) and trying to remove directory after killing copy process
D state of process is uninterruptible state. >From http://wiki.openvz.org/Processes_in_D_state D state occurs then the process is in uninterruptible sleep. This state is bad, because you can't do anything with the process in D state. Fortunately, process normally remains in such state not for so long. But if you have a heap of D state processes then some logic in system is disrupt. If that is happening, the very important thing is to determine where this unlucky sleep occurs. It is easy to do with ps command with l option. WCHAN column shows the name of the kernel function where the process is sleeping: In this case I guess it waits for network/nfs to copy the files and went into D state. You have to wait for some time to get the process back to normal state for the kill signal to really kill it. After that you would be able to remove the dir. On Thu, Mar 22, 2012 at 1:13 PM, Saju M wrote: > Getting error (Directory not empty) when copying file using 'cp' command to > shared location (NFS) and trying to remove directory after killing copy > process > > is it NFS configuration issue ? > > NFS config > # cat /etc/exports > /home/fluent/share *(rw,sync,no_subtree_check) > > > Using centos 6 as client > Ubuntu 10.04 NFS server > > I also tried centos 6 as NFS server, no hope > > What will be the reason ? > --- > > > 1) Terminal-1 as root user > # cp -ar /var/cache/cms/vm_disks/ubunu_11_server_real.disk.xm > /mnt/share/IMG_u2/disk1.xm > > > > 2) Terminal-2 as root user > > > [root@localhost ~]# ps -aux | grep cp > Warning: bad syntax, perhaps a bogus '-'? See > /usr/share/doc/procps-3.2.8/FAQ > root 18 0.0 0.0 0 0 ? S 10:53 0:00 [cpuset] > root 31 0.0 0.0 0 0 ? S 10:53 0:00 [kacpid] > root 32 0.0 0.0 0 0 ? S 10:53 0:00 > [kacpi_notify] > root 33 0.0 0.0 0 0 ? S 10:53 0:00 > [kacpi_hotplug] > root 1660 0.0 0.0 9172 652 ? S 10:53 0:00 > /sbin/dhclient -d -4 -sf /usr/libexec/nm-dhcp-client.action -pf > /var/run/dhclient-eth0.pid -lf > /var/lib/dhclient/dhclient-5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03-eth0.lease > -cf /var/run/nm-dhclient-eth0.conf eth0 > root 1771 0.0 0.0 4132 516 ? Ss 10:53 0:00 > /usr/sbin/acpid > 68 1868 0.0 0.0 17860 668 ? S 10:53 0:00 > hald-addon-acpi: listening on acpid socket /var/run/acpid.socket > root 2322 2.9 1.2 144532 26016 tty1 Ss+ 10:54 1:12 > /usr/bin/Xorg :0 -nr -verbose -auth > /var/run/gdm/auth-for-gdm-Ov8O8L/database -nolisten tcp vt1 > nobody 2335 0.0 0.0 12936 436 ? S 10:54 0:00 > /usr/sbin/dnsmasq --strict-order --bind-interfaces > --pid-file=/var/run/libvirt/network/default.pid --conf-file= > --except-interface lo --listen-address 192.168.122.1 --dhcp-range > 192.168.122.2,192.168.122.254 > --dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases > --dhcp-lease-max=253 --dhcp-no-override > root 9675 4.5 0.0 113956 1140 pts/2 S+ 11:34 0:02 cp -i -ar > /var/cache/cms/vm_disks/ubunu_11_server_real.disk.xm > /mnt/share/IMG_u2/disk1.xm > root 9772 0.0 0.0 103304 840 pts/3 S+ 11:35 0:00 grep cp > [root@localhost ~]# > > > > > > [root@localhost ~]# kill -9 9675 > > > > > > [root@localhost ~]# ps -aux | grep cp > Warning: bad syntax, perhaps a bogus '-'? See > /usr/share/doc/procps-3.2.8/FAQ > root 18 0.0 0.0 0 0 ? S 10:53 0:00 [cpuset] > root 31 0.0 0.0 0 0 ? S 10:53 0:00 [kacpid] > root 32 0.0 0.0 0 0 ? S 10:53 0:00 > [kacpi_notify] > root 33 0.0 0.0 0 0 ? S 10:53 0:00 > [kacpi_hotplug] > root 1660 0.0 0.0 9172 652 ? S 10:53 0:00 > /sbin/dhclient -d -4 -sf /usr/libexec/nm-dhcp-client.action -pf > /var/run/dhclient-eth0.pid -lf > /var/lib/dhclient/dhclient-5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03-eth0.lease > -cf /var/run/nm-dhclient-eth0.conf eth0 > root 1771 0.0 0.0 4132 516 ? Ss 10:53 0:00 > /usr/sbin/acpid > 68 1868 0.0 0.0 17860 668 ? S 10:53 0:00 > hald-addon-acpi: listening on acpid socket /var/run/acpid.socket > root 2322 2.8 1.2 144532 25956 tty1 Rs+ 10:54 1:13 > /usr/bin/Xorg :0 -nr -verbose -auth > /var/run/gdm/auth-for-gdm-Ov8O8L/database -nolisten tcp vt1 > nobody 2335 0.0 0.0 12936 436 ? S 10:54 0:00 > /usr/sbin/dnsmasq --strict-order --bind-interfaces > --pid-file=/var/run/libvirt/network/default.pid --conf-file= > --except-interface lo --listen-address 192.168.122.1 --dhcp-range > 192.168.122.2,192.168.122.254 > --dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases > --dhcp-lease-max=253 --dhcp-no-override > root 9675 8.5 0.0 0 0 pts/2 D+ 11:34 0:06 [cp] > root 9780 0.0 0.0 103304 836 pts/3 S+ 11:36 0:00 grep
Re: [ILUG-Cochin.org] Getting error (Directory not empty) when copying file using 'cp' command to shared location (NFS) and trying to remove directory after killing copy process
Thanks unni, Here is the output of "ps -axl | grep cp" during this copy, kill and delete operation WCHAN column showing : sync_p, wait_i, nfs_wa, rpc_wa and sync_p # ps -axl | grep cp 4 0 11140 3050 20 0 113956 1056 sync_p Ds ? 0:00 cp -ar /var/cache/cms/vm_disks/ubunu_11_server_real.disk.xm /mnt/share/IMG_uu3/disk1.xm 4 0 11140 3050 20 0 113956 1056 wait_i Ds ? 0:00 cp -ar /var/cache/cms/vm_disks/ubunu_11_server_real.disk.xm /mnt/share/IMG_uu3/disk1.xm 4 0 11140 3050 20 0 113956 1056 nfs_wa Ds ? 0:00 cp -ar /var/cache/cms/vm_disks/ubunu_11_server_real.disk.xm /mnt/share/IMG_uu3/disk1.xm 4 0 11140 3050 20 0 113956 1056 rpc_wa Ds ? 0:00 cp -ar /var/cache/cms/vm_disks/ubunu_11_server_real.disk.xm /mnt/share/IMG_uu3/disk1.xm 4 0 11140 3050 20 0 0 0 sync_p Ds ? 0:00 [cp] On Thu, Mar 22, 2012 at 1:40 PM, unni krishnan wrote: > D state of process is uninterruptible state. > > From http://wiki.openvz.org/Processes_in_D_state > > D state occurs then the process is in uninterruptible sleep. This > state is bad, because you can't do anything with the process in D > state. Fortunately, process normally remains in such state not for so > long. But if you have a heap of D state processes then some logic in > system is disrupt. If that is happening, the very important thing is > to determine where this unlucky sleep occurs. It is easy to do with ps > command with l option. WCHAN column shows the name of the kernel > function where the process is sleeping: > > > In this case I guess it waits for network/nfs to copy the files and > went into D state. You have to wait for some time to get the process > back to normal state for the kill signal to really kill it. After that > you would be able to remove the dir. > > On Thu, Mar 22, 2012 at 1:13 PM, Saju M wrote: > > Getting error (Directory not empty) when copying file using 'cp' command > to > > shared location (NFS) and trying to remove directory after killing copy > > process > > > > is it NFS configuration issue ? > > > > NFS config > > # cat /etc/exports > > /home/fluent/share *(rw,sync,no_subtree_check) > > > > > > Using centos 6 as client > > Ubuntu 10.04 NFS server > > > > I also tried centos 6 as NFS server, no hope > > > > What will be the reason ? > > --- > > > > > > 1) Terminal-1 as root user > > # cp -ar /var/cache/cms/vm_disks/ubunu_11_server_real.disk.xm > > /mnt/share/IMG_u2/disk1.xm > > > > > > > > 2) Terminal-2 as root user > > > > > > [root@localhost ~]# ps -aux | grep cp > > Warning: bad syntax, perhaps a bogus '-'? See > > /usr/share/doc/procps-3.2.8/FAQ > > root18 0.0 0.0 0 0 ?S10:53 0:00 [cpuset] > > root31 0.0 0.0 0 0 ?S10:53 0:00 [kacpid] > > root32 0.0 0.0 0 0 ?S10:53 0:00 > > [kacpi_notify] > > root33 0.0 0.0 0 0 ?S10:53 0:00 > > [kacpi_hotplug] > > root 1660 0.0 0.0 9172 652 ?S10:53 0:00 > > /sbin/dhclient -d -4 -sf /usr/libexec/nm-dhcp-client.action -pf > > /var/run/dhclient-eth0.pid -lf > > > /var/lib/dhclient/dhclient-5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03-eth0.lease > > -cf /var/run/nm-dhclient-eth0.conf eth0 > > root 1771 0.0 0.0 4132 516 ?Ss 10:53 0:00 > > /usr/sbin/acpid > > 681868 0.0 0.0 17860 668 ?S10:53 0:00 > > hald-addon-acpi: listening on acpid socket /var/run/acpid.socket > > root 2322 2.9 1.2 144532 26016 tty1 Ss+ 10:54 1:12 > > /usr/bin/Xorg :0 -nr -verbose -auth > > /var/run/gdm/auth-for-gdm-Ov8O8L/database -nolisten tcp vt1 > > nobody2335 0.0 0.0 12936 436 ?S10:54 0:00 > > /usr/sbin/dnsmasq --strict-order --bind-interfaces > > --pid-file=/var/run/libvirt/network/default.pid --conf-file= > > --except-interface lo --listen-address 192.168.122.1 --dhcp-range > > 192.168.122.2,192.168.122.254 > > --dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases > > --dhcp-lease-max=253 --dhcp-no-override > > root 9675 4.5 0.0 113956 1140 pts/2S+ 11:34 0:02 cp -i > -ar > > /var/cache/cms/vm_disks/ubunu_11_server_real.disk.xm > > /mnt/share/IMG_u2/disk1.xm > > root 9772 0.0 0.0 103304 840 pts/3S+ 11:35 0:00 grep cp > > [root@localhost ~]# > > > > > > > > > > > > [root@localhost ~]# kill -9 9675 > > > > > > > > > > > > [root@localhost ~]# ps -aux | grep cp > > Warning: bad syntax, perhaps a bogus '-'? See > > /usr/share/doc/procps-3.2.8/FAQ > > root18 0.0 0.0 0 0 ?S10:53 0:00 [cpuset] > > root31 0.0 0.0 0 0 ?S10:53 0:00 [kacpid] > > root32 0.0 0.0 0 0 ?S10:53 0:00 > > [kacpi_notify] > > root33 0.0 0.0 0 0 ?S10:53 0:00 > > [kacpi_hotplug] > > root 1660 0.0 0.0 9172 652
Re: [ILUG-Cochin.org] Getting error (Directory not empty) when copying file using 'cp' command to shared location (NFS) and trying to remove directory after killing copy process
Hi, Please change the NFS configuration as given below and try again. NFS config # cat /etc/exports /home/fluent/share *(rw,sync,no_root_squash) no_root_squash is a setting that allows nfs clients to connect as root. Without this setting, the root user on clients that connect has the permissions of the user 'nfsnobody'. After making change to the /etc/exports file, run the command at the NFS server, # exportfs -avr Regards, Ebin On Thu, Mar 22, 2012 at 1:13 PM, Saju M wrote: > Getting error (Directory not empty) when copying file using 'cp' command > to shared location (NFS) and trying to remove directory after killing copy > process > > is it NFS configuration issue ? > > NFS config > # cat /etc/exports > /home/fluent/share *(rw,sync,no_subtree_check) > > > ___ Indian Libre User Group Cochin Mailing List http://www.ilug-cochin.org/mailing-list/ http://mail.ilug-cochin.org/mailman/listinfo/mailinglist_ilug-cochin.org #ilugko...@irc.freenode.net