dos2unix fails between filesystems
This document (7003392) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 10 Service Pack 2
Situation
Symptoms:
The dosfile is in the directory /mnt (filesystem: reiserfs) and the target directory is /tmp (filesystem: ext3), dos2unix fails converting the file:
hostname: ~ # cd /mnt/
hostname:/mnt # dos2unix -n /mnt/dosfile /tmp/unixfile
dos2unix: converting file /mnt/dosfile to file /tmp/unixfile in UNIX format ...
dos2unix: problems renaming './d2utmpll5EdT' to '/tmp/unixfile'
output file remains in './d2utmpll5EdT'
dos2unix: problems converting file /mnt/dosfile to file /tmp/unixfile
Change into the target directory /tmp and run dos2unix again, this time the file is converted:
hostname:/mnt # cd /tmp/
hostname:/tmp # dos2unix -n /mnt/dosfile /tmp/unixfile
dos2unix: converting file /mnt/dosfile to file /tmp/unixfile in UNIX format ...
The reason is that the output is generated first as temporary file in the current directory ('./d2utmpll5EdT') and then via rename, moved to the target directory, and rename() fails, because it does not support moves between filesystems.
Resolution
For SUSE Linux Enterprise Server 11 a patch resolving the problem is available.
Install the dos2unix update, dos2unix -3.1-438.22.1.
The dos2unix version in SUSE Linux Enterprise Server SP3 also corrects the problem.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:7003392
- Creation Date: 28-May-2009
- Modified Date:28-Sep-2022
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com