AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
Expand all | Collapse all

How to restore ".filename" in the root folder from a back-by-name mksysb

  • 1.  How to restore ".filename" in the root folder from a back-by-name mksysb

    Posted Mon March 10, 2025 04:40 PM

    A client on AIX 7.1 managed to clear all of the ".filename" files in the root folder.

    In reviewing the list, there's only a few needed or desired to be restored.

    restore -xqvf /usbmnt/usr/sys/inst.images/mksysb.img ./.profile (for example) does not work.

    All of the examples in documents show the restore of a "normally-named" (not hidden or dotted/hidden) file.

    Would someone know the "trick" to getting it restored?

    Thank you in advance!



    ------------------------------
    Bob Wyatt
    ------------------------------


  • 2.  RE: How to restore ".filename" in the root folder from a back-by-name mksysb

    Posted Tue March 11, 2025 02:54 AM

    Hi Bob

    Could you try to list the files in the mksysb image and grep for .profile? 

    EG: restore -Tqvf /usbmnt/usr/sys/inst.images/mksysb.img | grep .profile

    You can then check if the path is correct for the file you wish to restore. 

    Kind regards



    ------------------------------
    Lance Martincich
    ERP Systems Engineer
    City of Cape Town
    Cape Town
    +27832856514
    ------------------------------



  • 3.  RE: How to restore ".filename" in the root folder from a back-by-name mksysb

    Posted Tue March 11, 2025 08:24 AM

    I had better luck with restore -Tqvf [FILE] 2>&1  | grep -E '/\.'

    What about making a small LPAR and just restoring the whole MKSYSB?



    ------------------------------
    Alexander Pettitt
    ------------------------------



  • 4.  RE: How to restore ".filename" in the root folder from a back-by-name mksysb

    Posted Tue March 11, 2025 09:25 AM

    Alexander,

     

    I've not had an issue with the Tvf options... it reports the file exists and is in the desired folder (\ - root).

    The .profile is one of 9 hidden files (.filename) in the root folder I needed to restore – although they exist on disk, they are 0 bytes in size).

     

    Regards,

     

    Bob Wyatt






  • 5.  RE: How to restore ".filename" in the root folder from a back-by-name mksysb

    Posted Tue March 11, 2025 03:33 AM

    Are you sure that the file is in the mksysb?

    The command you wrote is correct and works if the file is in mksysb.



    ------------------------------
    Andrey Klyachkin

    https://www.power-devops.com
    ------------------------------



  • 6.  RE: How to restore ".filename" in the root folder from a back-by-name mksysb

    Posted Tue March 11, 2025 09:13 AM

    Andrey,

     

    The restore -Tvf shows the .profile path desired exists and is in the specified path.

    There was a total of 9 hidden (.filename) files that, although they exist, they are 0 bytes.

    None of the 9 files could be recovered from the mksysb with the described restore command in the original post.

     

    Regards,

     

    Bob Wyatt

    Integration/Support Specialist

    Ashwood Computer, Inc.

    bobw@ashwoodcomputer.com

    (609) 405-1151

     






  • 7.  RE: How to restore ".filename" in the root folder from a back-by-name mksysb

    Posted Tue March 11, 2025 09:40 AM

    Bob,

    if it shows that the file exists:

    • which AIX version do you have?
    • can you try to restore on another machine? The restore command restores files in the current directory, so simply create a temporary directory, cd into it, and restore the files from the mksysb image


    ------------------------------
    Andrey Klyachkin

    https://www.power-devops.com
    ------------------------------



  • 8.  RE: How to restore ".filename" in the root folder from a back-by-name mksysb

    Posted Tue March 11, 2025 10:17 AM

    Andrey,

     

    It is AIX 7100-05-06.

    Unfortunately, insufficient disk space to set up an LPAR or alternate disk restore.

     

    Some of the .files "missing" are from AIX 5.1 – not too concerned.

    Others were manually rebuilt, including the .profile; the accuracy or these are still being vetted, day by day...

     

    It seems odd that .files can't be selectively restored by name from a mksysb image without various work-arounds.

     

    Regards,

     

    Bob Wyatt






  • 9.  RE: How to restore ".filename" in the root folder from a back-by-name mksysb

    Posted Tue March 11, 2025 10:23 AM

    restore -xqvf [mksysb file]  './.profile' worked for me on AIX 7.3.2

     Cluster 51200 bytes (100 blocks).
        Volume number 1
        Date of backup: Mon Mar  3 08:29:40 EST 2025
        Files backed up by name
        User root
    x         1013 ./.profile
        total size: 1013
        files restored: 1

    -rw-r-----    1 root     system         1013 Dec 02 14:11 .profile



    ------------------------------
    Alexander Pettitt
    ------------------------------



  • 10.  RE: How to restore ".filename" in the root folder from a back-by-name mksysb

    Posted Tue March 11, 2025 11:27 AM

    Bob,

    I think the reason why you can't restore the files is not the restore command, but as you write - you have not enough space in your filesystem. That's why it is easier to copy the mksysb file to another system, unpack the files you need there, and copy the files back.

    The command you use is correct and works on AIX 7.1 without any problems. I can't see the file list of your mksysb, but I trust you that the files are there. It means the problem is on your system. That's why to make it easier for you, unpack the files on another system.



    ------------------------------
    Andrey Klyachkin

    https://www.power-devops.com
    ------------------------------



  • 11.  RE: How to restore ".filename" in the root folder from a back-by-name mksysb

    Posted Tue March 11, 2025 03:50 PM

    Andrey,

     

    The total size of the 9 hidden files is less than 10 MB.

    The root file system has more than 1 GB of free space.

     

    As others report success on different AIX levels and the command used as being correct, I can only presume that there is something about this system contributing to the difficulty as was suggested.

    It would not appear to be insufficient disk space, however.

     

    Regards,

     

    Bob Wyatt






  • 12.  RE: How to restore ".filename" in the root folder from a back-by-name mksysb

    Posted Thu March 13, 2025 09:28 AM

    Hello Bob,

    I tried it also with AIX 7.2 TL05 and AIX 7.3 TL 02 the only thing is you have to use single ' in the selection as Alexandre also mentioned.

    restore -Xqvf  ' ./.profile'

    And I think i used the X instead of x, but not sure here.

    see man page:

    To restore files beginning at a specified volume number

    restore -X Number [-MdnqveOQ ] [ -b Number] [ -f Device] [ -s Number] [ -E { force | ignore | warn }] [File ... ]

    Did you tried that? 



    ------------------------------
    Christian Sonnemans
    Tactical Unix system engineer
    De Volksbank
    Den Bosch
    ------------------------------



  • 13.  RE: How to restore ".filename" in the root folder from a back-by-name mksysb

    Posted Tue March 11, 2025 09:28 AM
    Bob Wyatt would like to recall the message, "Re: How to restore ".filename" in the root folder from a back-by-name mksysb".