ubuntu中wine的安装位置

QUESTION: Where is my wine’s C: drive?

 

SHORT ANSWER: /home/$USER/.wine/drive_c

 

As you probably know Linux and Windows have quite a different approach to maintaining and presenting files-systems, files and folders.

 

Linux is using the “virtual tree” approach whereby the system has knowledge of all of its paths, arranged in one global tree hierarchy, with the the various storage devices (hard disk, tape drives, flash drives, CD-ROMs, network drives)  attached or as the linux jargon has it “mounted”, to this virtual tree.

 

Windows has used the “hardware-based” approach, where each physical drive (or logical drive, a.k.a. “partition”) is assigned a drive letter followed by a colon (A:, B:, C: … etc). Under each drive there is a hierarchical tree system very much like in linux but there is no one global absolute hierarchical tree of paths and files – you have as many trees as there are drives (drive letters) known to your system.

 

Historically, the first two drive letters A and B were reserved for floppy drives. Thus, the first hard drive was, designated as C:.  Not that you could not re-arrange your drives and have A: as your hard-drive, Q: as your CD-ROM and Z: as your floppy but 99% of programs (and humans!) would base a lot of their assumptions on C: being the first hard drive in the system and so most developers would design their applications with that in mind. On the C: drive, it is common to have such well-known paths as  “C:\Windows”, “C:\Documents and Settings” and “C:\Program Files”. Note that “C:\Documents and Settings” is now renamed to “C:\Users” in Windows 7.

Most program installers would typically offer the user to install themselves somewhere underneath “C:\Program Files” and store program config settings in the user’s folder under “C:\Documents and Settings”.

Since most Windows applications will rely on the system having at least one drive (which is typically named C:, as explained above), wine also needs to mimic this behaviour and maintain at least one virtual hard-disk (C:) so that the windows programs you want to use could run normally.

 

The question is – where is it? Where is wine’s C drive? You can’t have  /C: as the colon character “:” is not a legal path character in Linux. Perhaps if could be named /C, then? Yes that could be a possible solution (in theory), however there’s some problems with that as well. Most users would not have permissions to create folders under the root directory. And, yet another problem with this setup would be that different users could overwrite their apps and data if all of their wine instances all wrote and read from one global location.

 

So, how can we find out where is our wine’s C: drive?

 

Well we could run the winecfg utility and see what it has to say winecfg screenshot about this?

Looking in the Drives tab of winecfg, however, we can see that the C: drive is mapped to ../drive_c, which is obviously not very useful (as this is a relative path and could be anywhere). Well, at least we know that it is called drive_c… How can we use this information to find the C: drive used by wine? Well for one thing we could run “locate drive_c” and see if it finds any folders named drive_c in our system!

 

Type “locate drive_c” in your terminal program. This gives a long list of files and folders containing the string drive_c which is not too useful so we’ll use grep to show us just the dirve_c folders and filter out all the other noise, since it is this folder we are looking for:

# locate drive_c | grep “drive_c$”

This gives a nice short list of only the folders named “drive_c”, which on my system looks like this:

/opt/google/picasa/3.0/wine/drive_c
/home/encho/.google/picasa/3.0/drive_c
/home/encho/.wine/drive_c

 

As the first two are obviously specific to a picasa installation, we are left with the .wine/drive_c folder under my home directory is the only possible location of wine’s C: drive for my user. It will hold true for most systems out there that the C: drive as known to wine will be under  /home/$USER/.wine/drive_c, but even if it is not there you can use the above procedure to locate your wine’s C: drive.

 

At this point one might ask: “Ok, great, now I know where my C: drive is (under wine) and so what? What do I need this for? Wine will handle it for me anyway – whenever a program asks for the C drive wine will direct it to that folder, so why do I need to bother knowing where it actually lives?”

 

Fair question, and the answer is: “In most cases you do not need to know where you wine’s C drive is, however you must ensure that the disk (and here I mean the physical disk as known to your Linux system) where your wine’s C: drive is located has enough space on it or you will start getting errors like “Not enough space on C: drive”. And to ensure that your disk has enough spacde on it you, must of course, know where your wine is installed and ensure there is enough room on it. As mentioned above this is usually under your home folder so it all boils down to knowing where your home directory is mounted. As matter of fact

 

To find out how much free space you have on that disk go to your .wine folder and issue a df command there. It will report free disk space on that device which is exactly what you need:

#cd ~/.wine

# df -h .

Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb6              20G   16G  3.4G  83% /home

As you can see in my case I have 3.5 GB available on my /home filesystem which is not too much so I need to watch it, especialy if installing disk-space-hungry windows apps!

 

Cheers folks, hope that was useful 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值