马磊
2012-May-22 09:34 UTC
[Libguestfs] 【help】why not support showing filename containing chinese characters with the ls function?
Hi,everyone: As the subject says, why chinese characters are shown as '?' by using ls function? Did anyone encounter the same problem and does resolution exist? Looking forward to your reply. Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libguestfs/attachments/20120522/e3eb401a/attachment.htm>
Richard W.M. Jones
2012-May-22 10:14 UTC
[Libguestfs] 【help】why not support showing filename containing chinese characters with the ls function?
On Tue, May 22, 2012 at 05:34:40PM +0800, ?? wrote:> Hi,everyone: > As the subject says, why chinese characters are shown as '?' by using > ls function? > Did anyone encounter the same problem and does resolution exist? > Looking forward to your reply. Thanks in advance.I tried this, and it works for me: $ qemu-img create -f qcow2 -b /dev/vg_pin/F16x64 chinese-chars.img Formatting 'chinese-chars.img', fmt=qcow2 size=21474836480 backing_file='/dev/vg_pin/F16x64' encryption=off cluster_size=65536 $ guestfish -a chinese-chars.img -i touch "/??" $ guestfish --ro -a chinese-chars.img -i Welcome to guestfish, the libguestfs filesystem interactive shell for editing virtual machine filesystems. Type: 'help' for help on commands 'man' to read the manual 'quit' to quit the shell Operating system: Fedora release 16 (Verne) /dev/mapper/vg_f16x64-lv_root mounted on / /dev/vda2 mounted on /boot ><fs> ls / bin boot dev etc home lib lib64 lost+found media mnt opt proc root run sbin selinux srv sys tmp usr var ?? ><fs> ll / total 126 dr-xr-xr-x. 23 root root 4096 May 22 11:10 . drwxr-xr-x 23 500 500 4096 May 22 11:11 .. dr-xr-xr-x. 2 root root 4096 Mar 6 11:18 bin dr-xr-xr-x. 6 root root 1024 Jan 25 09:47 boot drwxr-xr-x. 5 root root 4096 Aug 16 2011 dev drwxr-xr-x. 135 root root 12288 Apr 18 13:40 etc drwxr-xr-x. 3 root root 4096 Jul 29 2011 home dr-xr-xr-x. 11 root root 4096 Nov 28 15:19 lib dr-xr-xr-x. 11 root root 12288 Mar 6 11:18 lib64 drwx------. 2 root root 16384 Aug 16 2011 lost+found drwxr-xr-x. 2 root root 4096 Jun 29 2011 media drwxr-xr-x. 4 root root 4096 Nov 28 14:22 mnt drwxr-xr-x. 2 root root 4096 Jul 29 2011 opt drwxrwxr-x 2 root root 4096 Aug 16 2011 proc dr-xr-x---. 6 root root 4096 Nov 25 08:44 root drwxr-xr-x. 21 root root 4096 Aug 16 2011 run dr-xr-xr-x. 2 root root 12288 Mar 6 11:18 sbin drwxr-xr-x 3 root root 4096 Jun 29 2011 selinux drwxr-xr-x. 2 root root 4096 Jul 29 2011 srv drwxrwxr-x. 2 root root 4096 Aug 16 2011 sys drwxrwxrwt. 10 root root 4096 Apr 18 13:40 tmp drwxr-xr-x. 13 root root 4096 Aug 28 2011 usr drwxr-xr-x. 18 root root 4096 Aug 28 2011 var -rw-r--r-- 1 root root 0 May 22 11:10 ?? What are your language settings, eg. the locale and the environment variables $LANG etc? You can find out by running the 'locale' command: $ locale LANG=en_GB.UTF-8 LC_CTYPE="en_GB.UTF-8" LC_NUMERIC="en_GB.UTF-8" LC_TIME="en_GB.UTF-8" LC_COLLATE="en_GB.UTF-8" LC_MONETARY="en_GB.UTF-8" LC_MESSAGES="en_GB.UTF-8" LC_PAPER="en_GB.UTF-8" LC_NAME="en_GB.UTF-8" LC_ADDRESS="en_GB.UTF-8" LC_TELEPHONE="en_GB.UTF-8" LC_MEASUREMENT="en_GB.UTF-8" LC_IDENTIFICATION="en_GB.UTF-8" LC_ALL If you can reproduce this issue, please file a bug: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
马磊
2012-May-22 15:19 UTC
[Libguestfs] 【help】why not support showing filename containing chinese characters with the ls function?
On Tue, May 22, 2012 at 11:08 PM, ?? <aware.why at gmail.com> wrote:> > > On Tue, May 22, 2012 at 7:48 PM, Richard W.M. Jones <rjones at redhat.com>wrote: > >> On Tue, May 22, 2012 at 07:44:04PM +0800, ?? wrote: >> > On Tue, May 22, 2012 at 7:37 PM, Richard W.M. Jones <rjones at redhat.com >> >wrote: >> > >> > > On Tue, May 22, 2012 at 06:38:45PM +0800, ?? wrote: >> > > > [malei at xen-test2 ~]$ guestfish --rw -a /home/malei/d.img >> > > > >> > > > Welcome to guestfish, the libguestfs filesystem interactive shell >> for >> > > > editing virtual machine filesystems. >> > > > >> > > > Type: 'help' for help on commands >> > > > 'man' to read the manual >> > > > 'quit' to quit the shell >> > > > >> > > > ><fs> mount-options '' /dev/vda1 / >> > > > libguestfs: error: mount_options: call launch before using this >> function >> > > > (in guestfish, don't forget to use the 'run' command) >> > > > ><fs> launch >> > > > ><fs> mount-options '' /dev/vda1 / >> > > > ><fs> ls / >> > > > ?? ????.txt >> > > > ?? ????.wav >> > > > ?? WinRAR ZIP ????.zip >> > > > root1 >> > > > root2 >> > > > ><fs> >> > > > ==============================================>> > > > Does it have something to do with the LANG environment variable or >> the >> > > disk >> > > > img which is not bootable? >> > > >> > > I guess this is a FAT or VFAT image? (Try the 'list-filesystems' >> command). >> > > >> > > There are several bugs, they even prevent me from creating such an >> > > image to start with :-( I have filed these: >> > > >> > > https://bugzilla.redhat.com/show_bug.cgi?id=823885 >> > > https://bugzilla.redhat.com/show_bug.cgi?id=823887 >> > > >> > > How large is 'd.img'? Would it be possible for me to get a copy of >> > > it, or of a similar image that fails in the same way? >> > > >> > > Rich. >> > > >> > > -- >> > > Richard Jones, Virtualization Group, Red Hat >> > > http://people.redhat.com/~rjones >> > > virt-p2v converts physical machines to virtual machines. Boot with a >> > > live CD or over the network (PXE) and turn machines into Xen guests. >> > > http://et.redhat.com/~rjones/virt-p2v >> > >> > >> > >> > >> > You're right! The partition containg chinese-character-name files >> is >> > vfat filesystem. >> > [malei at xen-test2 ~]$ guestfish --rw -a /home/malei/d.img >> > >> > Welcome to guestfish, the libguestfs filesystem interactive shell for >> > editing virtual machine filesystems. >> > >> > Type: 'help' for help on commands >> > 'man' to read the manual >> > 'quit' to quit the shell >> > >> > ><fs> run >> > ><fs> list_filesystems >> > /dev/vda1: vfat >> > /dev/vda2: ntfs >> > /dev/vda3: ntfs >> > /dev/vda4: unknown >> > /dev/vda5: vfat >> > /dev/vda6: vfat >> > /dev/vda7: ntfs >> > ><fs> mount-options /dev/vda2 / >> > mount-options should have 3 parameter(s) >> > type 'help mount-options' for help on mount-options >> > ><fs> mount-options '' /dev/vda2 / >> > ><fs> ls / >> > System Volume Information >> > root1 >> > root2 >> > ?? WinRAR ZIP ????.zip >> > ?? ????.txt >> > ?? ????.wav >> >> It'd be great if you could get me / point me to a vfat image that >> contains Chinese character filenames. One way (assuming this image >> does not contain sensitive data) is: >> >> guestfish --ro -a /home/malei/d.img >> ><fs> run >> ><fs> download /dev/vda1 - | xz --best > /tmp/vda1.img.xz >> >> and then send me the file /tmp/vda1.img.xz. >> >> Rich. >> >> -- >> Richard Jones, Virtualization Group, Red Hat >> http://people.redhat.com/~rjones >> libguestfs lets you edit virtual machines. Supports shell scripting, >> bindings from many languages. http://libguestfs.org >> > > I have sent it to you, check please. >BTW, another problem about mount: [malei at xen-test2 ~]$ guestfish --rw -a d.img -m /dev/vda1:/:utf8 libguestfs: error: mount_options: you must mount something on / first guestfish: '/dev/vda1' could not be mounted. Did you mean one of these? /dev/vda1 (vfat) /dev/vda2 (ntfs) /dev/vda3 (ntfs) /dev/vda4 (unknown) /dev/vda5 (vfat) /dev/vda6 (vfat) /dev/vda7 (ntfs) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libguestfs/attachments/20120522/07dd0db5/attachment.htm>
Maybe Matching Threads
- [PATCH] New APIs: {compress, gzip, xz}-out, {compress, gzip, xz}-device-out.
- 【Problem】 about using gdbsx to debug guest linux VM
- [Problem with xen-4.1.2] Creating device model failed when disable `-vnc` related option in qemu-dm
- python-guestfs
- [PATCH] : Adding dlabel option to chain.c32