duplicate files in tmp
Hi All,
I'm newbie to yocto, currently I use imx-linux-zeus as the develop environment.
When I bitbaked the system, I found there are a lot of duplicate files in <build>/tmp, for example, there is a directory named "recipe-sysroot-native" in every package, which directory is serveral hundreds of MB in size. I'm confused that why don't use link file type to instead of duplicate copies, which can save tens of GB size. I know that disk capacity should not be a concern but it's always welcome to have a small size project.
B.R.
Nus
Quoted 1 line · On Tue, 31 Mar 2020 at 09:57, nus1998 <[email protected]> wrote:
When I bitbaked the system, I found there are a lot of duplicate files in <build>/tmp, for example, there is a directory named "recipe-sysroot-native" in every package, which directory is serveral hundreds of MB in size. I'm confused that why don't use link file type to instead of duplicate copies, which can save tens of GB size. I know that disk capacity should not be a concern but it's always welcome to have a small size project.
They are links, but hardlinks not softlinks for efficiency and even less disk usage.
Ross
Well, Ubuntu doesn't tell any difference between a normal file and a hard link file on gui file explore, verified by "ls -i". thanks<br/><br/>B.R.<br/>Nus
Quoted 7 lines · Ross Burton
Quoted 1 line · On Tue, 31 Mar 2020 at 09:57, nus1998 <[email protected]> wrote:
When I bitbaked the system, I found there are a lot of duplicate files in <build>/tmp, for example, there is a directory named "recipe-sysroot-native" in every package, which directory is serveral hundreds of MB in size. I'm confused that why don't use link file type to instead of duplicate copies, which can save tens of GB size. I know that disk capacity should not be a concern but it's always welcome to have a small size project.
They are links, but hardlinks not softlinks for efficiency and even less disk usage.
Ross
Quoted 1 line · On Tue, 31 Mar 2020 at 10:14, nus1998 <[email protected]> wrote:
Well, Ubuntu doesn't tell any difference between a normal file and a hard link file on gui file explore, verified by "ls -i". thanks<br/><br/>B.R.<br/>Nus
Right. You'll need to use 'ls -l':
$ touch foo $ ls -l foo -rw-r--r-- 1 ross staff 0 Mar 31 11:46 foo $ ln foo bar $ ls -l foo bar -rw-r--r-- 2 ross staff 0 Mar 31 11:46 bar -rw-r--r-- 2 ross staff 0 Mar 31 11:46 foo
The second column is 'link count'. If you've never encountered hard links before, look them up.
Ross