Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to adjust the inode structure of opt partition under Solaris

2025-02-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article is about how to adjust the inode structure of opt partitions under Solaris. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Please refer to the following for specific operations:

0. View the inode information of the original opt partition:

# df-F ufs-o I / opt

1. Shut down the system to ok (if you haven't stopped the host for a long time, check the health of the system and its hardware in advance, and back up the important data in the system. )

# init 0

two。 Boot the system to single-user mode:

Ok boot-s

3. Use the ufsadmp command to back up the / opt directory to another local host hard drive or tape drive

(if the opt partition is mirrored using SDS, please change / dev/rdsk to / dev/md/rdsk in the following procedure)

a. Back up to another local host hard drive:

# mkdir / optbak

# mount / dev/dsk/cxtxdxsx / optbak (where cxtxdxsx is a slice of another local host's hard disk, and the size cannot be less than the size of the / opt partition)

# ufsdump 0uf / optbak/opt.dump / dev/rdsk/cxtxdxsx (cxtxdxsx here is the slice of the hard disk where the opt directory is located)

# umount / optbak

b. Tape backup: (make sure the tape used is intact and there is no other important data)

Local tape backup:

# mt-f / dev/rmt/0 status

If you have more than one tape device, the device is: / dev/rmt/1, / dev/rmt/2...

You may see the following message:

Quantum DLT7000 tape drive:

Sense key (0x0) = nosense residual= 0 retries= 0

File no= 0 block no= 0

Sense key (0x0) = nosense means that your system can access the tape normally.

Sense key (0x6) = unit attention indicates that the device may have been reset or has just been powered on

Sense key (0x13) = EOT indicates that the tape may be damaged

/ dev/rmt/0: no tape loaded or drive offline this message indicates that the tape cannot be accessed

No such file or directory if you have this message, your system will not be able to communicate with your tape device. Check to see if the tape drive is powered on and if the connection is normal

# mt-f / dev/rmt/0 rewind

# ufsdump 0uf / dev/rmt/0 / dev/rdsk/cxtxdxsx (cxtxdxsx here is the slice of the hard disk where the opt directory is located)

Remote tape backup: (if you do not have a tape drive locally, you can use a tape drive on another host for backup. The xxx.xxx.xxx.xxx below is the host IP with tapes)

# add "+" to vi / etc/.rhosts (do not add quotation marks)

# mt-f / dev/rmt/0 status

# mt-f / dev/rmt/0 rewind

# ufsdump 0uf xxx.xxx.xxx.xxx:/dev/rmt/0 / dev/rdsk/cxtxdxsx (cxtxdxsx here is the slice of the hard drive where the opt directory is located)

4. Re-create the file system for opt:

# newfs-I xxxxxxxxxx / dev/rdsk/cxtxdxsx (the xxxxxxxxxx here is twice the number of inode seen in step 0 / dev/rdsk/cxtxdxsx)

5. Restore opt partition data:

a. Restore from another local host hard drive:

# mount / dev/dsk/cxtxdxsx / opt (cxtxdxsx here is the slice of the hard disk where the opt directory is located)

# mount / dev/dsk/cxtxdxsx / optbak (cxtxdxsx here is a slice of the opt backed up by the hard disk of another local host)

# cd / opt

# ufsrestore rvf / optbak/opt.dump

# rm restoresymtable

# cd /

# umount / opt

# umount / optbak

# fsck / dev/rdsk/cxtxdxsx (cxtxdxsx here is the slice of the hard drive where the opt directory is located)

b. Recover from tape:

Restore from local tape:

# mount / dev/dsk/cxtxdxsx / opt (cxtxdxsx here is the slice of the hard disk where the opt directory is located)

# cd / opt

# ufsrestore rvf / dev/rmt/0

# rm restoresymtable

# cd /

# umount / opt

# umount / optbak

# fsck / dev/rdsk/cxtxdxsx (cxtxdxsx here is the slice of the hard drive where the opt directory is located)

Recover from a remote tape drive: (the following xxx.xxx.xxx.xxx is the host IP with tape)

# mount / dev/dsk/cxtxdxsx / opt (cxtxdxsx here is the slice of the hard disk where the opt directory is located)

# cd / opt

# ufsrestore rvf xxx.xxx.xxx.xxx:/dev/rmt/0

# rm restoresymtable

# cd /

# umount / opt

# umount / optbak

# fsck / dev/rdsk/cxtxdxsx (cxtxdxsx here is the slice of the hard drive where the opt directory is located)

6. Restart the host:

# reboot

7. View the inode of the opt partition:

# df-F ufs-o I / opt

Thank you for reading! This is the end of this article on "how to adjust the inode structure of opt partition under Solaris". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report