HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Duplicate system files
Operating System - HP-UX
1825771
Members
2360
Online
109687
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2002 03:51 PM
01-29-2002 03:51 PM
I am seeing lot of duplicate files on most of my systems.
For eg.. there are two versions of lvchange.
# ls -l /sbin/lvchange
-r-sr-xr-x 31 root sys 835584 Sep 12 17:26 /sbin/lvchange
# ls -l /usr/sbin/lvchange
-r-sr-xr-x 31 root sys 557056 Sep 12 17:26 /usr/sbin/lvchange
There are many more such files.. Why does HPUX provide two such versions for many system files?
Thanks
Krishnan
For eg.. there are two versions of lvchange.
# ls -l /sbin/lvchange
-r-sr-xr-x 31 root sys 835584 Sep 12 17:26 /sbin/lvchange
# ls -l /usr/sbin/lvchange
-r-sr-xr-x 31 root sys 557056 Sep 12 17:26 /usr/sbin/lvchange
There are many more such files.. Why does HPUX provide two such versions for many system files?
Thanks
Krishnan
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2002 04:02 PM
01-29-2002 04:02 PM
Re: Duplicate system files
I think from memory that one is dynamically linked and the other is not.
What this means essentially is that one is a "stand alone" the other needs libraries to work.
Scott.
What this means essentially is that one is a "stand alone" the other needs libraries to work.
Scott.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2002 04:21 PM
01-29-2002 04:21 PM
Solution
From Technical DB
Files in /sbin are statically linked so that they won't need shared libraries to run. This is so that the commands will work when the system is in single-user mode, when other file systems like /usr are not mounted. If there is no /usr, there is no /usr/lib (where shared libraries live) and no /usr/sbin (where many system-administration commands live). Files in /sbin are often not NLS-smart either, meaning they speak only the default language
(C for computer). By the way, the problem of "no shared libraries in single-user mode" is the reason why the shell for the super-user needs to be /sbin/sh, not/usr/bin/sh. When the system is running in multi-user state, /usr (with /usr/lib and /usr/sbin) is mounted and its files are available. Also, the super-user's $PATH is set to use /usr/sbin, which is defined by the SVR4 (V.4) file system conventions and on the hier(5) manual page as being the location for system administration commands. What to do with programs that are useful in single-user mode (/sbin) and in multi-user mode (/usr/sbin)?
* One way would be to install duplicate copies of a binary in both /sbin and /usr/sbin, but that would waste too much disk space.
* Another way to solve the problem is to symlink the required file from /sbin to /usr/sbin. This second choice is the approach taken by the `mount' command, as an example:
# ll /usr/sbin/mount
lrwxr-xr-x 1 root sys 11 Jan 5 14:48 /usr/sbin/mount -> /sbin/mount
When the super-user types `mount', his shell runs /usr/sbin/mount because that directory is first in his $PATH. The file system de references the symlink to run the /sbin/mount command.
* Another way to solve the problem is to ship two versions of the binaries. LVM takes this approach:
# ll /sbin/vgcfgrestore /usr/sbin/vgcfgrestore
-r-sr-xr-x 24 root sys 528384 Dec 6 00:00 /sbin/vgcfgrestore
-r-sr-xr-x 24 root sys 327680 Dec 6 00:00 /usr/sbin/vgcfgrestore
Unlike the LVM commands in /sbin, the LVM commands in /usr/sbin use shared libraries. This is more efficient for the system at runtime. The LVM commands in /sbin save further space in the / logical volume by not being internationalized. They save even more disk space because each individual LVM command is a hard link to one single LVM command binary. The disk usage for LVM commands went from 3 Mb (= 3000 Kb) to 300 Kb using this method. Other HP subsystems like the optional HP product SoftBench use this same method to conserve disk space. /sbin has links in it, too, both hard and symbolic, but their targets are other files in /sbin.
Files in /sbin are statically linked so that they won't need shared libraries to run. This is so that the commands will work when the system is in single-user mode, when other file systems like /usr are not mounted. If there is no /usr, there is no /usr/lib (where shared libraries live) and no /usr/sbin (where many system-administration commands live). Files in /sbin are often not NLS-smart either, meaning they speak only the default language
(C for computer). By the way, the problem of "no shared libraries in single-user mode" is the reason why the shell for the super-user needs to be /sbin/sh, not/usr/bin/sh. When the system is running in multi-user state, /usr (with /usr/lib and /usr/sbin) is mounted and its files are available. Also, the super-user's $PATH is set to use /usr/sbin, which is defined by the SVR4 (V.4) file system conventions and on the hier(5) manual page as being the location for system administration commands. What to do with programs that are useful in single-user mode (/sbin) and in multi-user mode (/usr/sbin)?
* One way would be to install duplicate copies of a binary in both /sbin and /usr/sbin, but that would waste too much disk space.
* Another way to solve the problem is to symlink the required file from /sbin to /usr/sbin. This second choice is the approach taken by the `mount' command, as an example:
# ll /usr/sbin/mount
lrwxr-xr-x 1 root sys 11 Jan 5 14:48 /usr/sbin/mount -> /sbin/mount
When the super-user types `mount', his shell runs /usr/sbin/mount because that directory is first in his $PATH. The file system de references the symlink to run the /sbin/mount command.
* Another way to solve the problem is to ship two versions of the binaries. LVM takes this approach:
# ll /sbin/vgcfgrestore /usr/sbin/vgcfgrestore
-r-sr-xr-x 24 root sys 528384 Dec 6 00:00 /sbin/vgcfgrestore
-r-sr-xr-x 24 root sys 327680 Dec 6 00:00 /usr/sbin/vgcfgrestore
Unlike the LVM commands in /sbin, the LVM commands in /usr/sbin use shared libraries. This is more efficient for the system at runtime. The LVM commands in /sbin save further space in the / logical volume by not being internationalized. They save even more disk space because each individual LVM command is a hard link to one single LVM command binary. The disk usage for LVM commands went from 3 Mb (= 3000 Kb) to 300 Kb using this method. Other HP subsystems like the optional HP product SoftBench use this same method to conserve disk space. /sbin has links in it, too, both hard and symbolic, but their targets are other files in /sbin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2002 04:27 PM
01-29-2002 04:27 PM
Re: Duplicate system files
Hi:
Scott is correct. The versions in /sbin are linked staticly. Those in /usr are dynamically linked. To see this, do:
# chatr /usr/sbin/lvchange
# chatr /sbin/lvchange
Regards!
...JRF...
Scott is correct. The versions in /sbin are linked staticly. Those in /usr are dynamically linked. To see this, do:
# chatr /usr/sbin/lvchange
# chatr /sbin/lvchange
Regards!
...JRF...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP