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

[Solaris] Solaris file system management 1 creation of UFS file system

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Solaris File system Management 1

Creation of UFS file system

OS:oracle solaris 10

Add 25g hard disk, divided into three regions, the size is 15g 8g 2g

Respectively mount to / U01 15g

/ software 8g

Leave a 2g to create a swap

1 add controller and hard disk to virtual machine

View current file system information

[root@solaris188:/] # df-h

Check the available hard drives in the current operating system. Only one hard disk created at the time of creation is c0t0d0, and the view ends with ctrl+c.

[root@solaris188:/] # format

1.1 shut down the current operating system normally

[root@solaris188:/] # shutdown-y-g0-i5

Or init 5

Poweroff

1.2 add controllers, add hard drives

Add a SCSI controller

Add a 25g hard disk to the newly added SCSI controller

Select to create a new virtual disk

Start the virtual machine after the addition is completed

2 partition the disk to format

Use the format command to see if the system recognizes the disk

[root@solaris188:/] # format

The newly added hard disk c1t0d0 has been recognized.

If you do not recognize it, you can ctrl + c exit, then use the devfsadm command to scan the system devices, and then format to view

[root@solaris188:/] # devfsadm

Enter the newly added hard disk serial number 1, enter, enter, enter.

Enter p (the initials of partition) to partition the disk

Format > p

Because it is a newly added disk, it is prompted that the fdisk operation is required first.

Run the fdisk program to create a solaris fdisk partition and type y to accept

Format > fdisk

Enter help to view the currently available commands

Format > help

Enter p again for partition partition

Format > p

Enter p to display the current partition table where p corresponds to print

Partition > p

For those that cannot be used on No. 2, No. 8, and No. 9, you can choose the remaining 0prime1 and 3-7 when zoning.

Enter 0, select partition 0, enter enter directly by default for the first two items, enter 0 starting cyl size and enter 15gb by default

Partition > 0

Help view the currently available commands, p display the current partition table

Partition > p

As you can see, if the Cylinders of partition 0 is 0-1958, the next partition cyl should start from 1959.

Enter 1, select partition 1, enter enter directly by default for the first two items, enter 1959 starting cyl size and enter 8gb

P displays the current partition table

Partition > p

As you can see, if Cylinders is 0-3003, the next partition cyl should start at 3004.

Note that No. 2 cannot be used. You can use 3-7.

Enter 3, select partition 3, enter the first two items directly by default, enter 3004 starting cyl and enter 2gb directly will report an error. If there is insufficient remaining disk, you can enter it? To view the available size, enter 1.96gb

P displays the current partition table

Partition > p

Help to view currently available commands, quit to return to the format main menu

Partition > help

Partition > quit

Label saves current partition information, y continues, verify displays partition information

Format > label

Format > verify

Quit exits format Partition menu

Format > quit

3 format the partition newfs

Note that the newly divided three zones are formatted, which are s0s1s3, the unformatted devices are bare devices, and the directory is / dev/rdsk

/ dev/rdsk/c1t0d0s0

/ dev/rdsk/c1t0d0s1

/ dev/rdsk/c1t0d0s3

[root@solaris188:/] # newfs / dev/rdsk/c1t0d0s0

[root@solaris188:/] # newfs / dev/rdsk/c1t0d0s1

[root@solaris188:/] # newfs / dev/rdsk/c1t0d0s3

4 create mount point mkdir (directory)

Create two directories / U01 and / software as mount points

[root@solaris188:/] # mkdir / u01

[root@solaris188:/] # mkdir / software

5 temporarily mount the file system mount (invalid after reboot)

Generate files in the / U01 directory for comparison

[root@solaris188:/] # echo "hello,u01" > / u01/file1

[root@solaris188:/] # cat / u01/file1

View current file system information

[root@solaris188:/] # df-h

Use the mount command to mount the file system manually. / U01 corresponds to s015g / software corresponds to s1.8g.

Note that after formatting, the device is a block device, and the corresponding directory is / dev/dsk

[root@solaris188:/] # mount / dev/dsk/c1t0d0s0 / u01

[root@solaris188:/] # mount / dev/dsk/c1t0d0s1 / software

View file system information after mounting is complete

[root@solaris188:/] # df-h

View the contents of / U01, the file1 file does not display

[root@solaris188:/] # ls / u01

Generate a new file in / U01

[root@solaris188:/] # echo "hello,new U01" > / u01/file1

[root@solaris188:/] # ls / u01

[root@solaris188:/] # cat / u01/file1

6 unmount umount of file system

Open a new session

Cd / u01

Vi / u01/file1

Unmount / U01 / software, error / U01 busy df-h View file system / software unmounted successfully

[root@solaris188:/] # umount / u01

[root@solaris188:/] # umount / software

7 stop accessing the file system process fuser

View and stop the process of accessing / U01

[root@solaris188:/] # fuser-cu / U01

[root@solaris188:/] # fuser-ck / U01

[root@solaris188:/] # fuser-cu / U01

Uninstall / U01 again successfully view the contents of the file under / U01, which is the old file1 before

[root@solaris188:/] # umount / u01

[root@solaris188:/] # df-h

[root@solaris188:/] # ls / u01

[root@solaris188:/] # cat / u01/file1

Manual mount

[root@solaris188:/] # mount / dev/dsk/c1t0d0s0 / u01

[root@solaris188:/] # mount / dev/dsk/c1t0d0s1 / software

[root@solaris188:/] # df-h

[root@solaris188:/] # reboot

Check again after reboot. There is no / U01 / software in the file system.

[root@solaris188:/] # df-h

To take effect permanently (the restart is still in effect), you need to write / etc/vfstab to automatically mount the boot.

8 automatically mount when booting

View the first configuration file

[root@solaris188:/] # cat / etc/vfstab

Block device, bare device, mount point, file system type, whether to post, whether to boot mount, mount option

Check the value of the order:

-ignore swap (virtual file system)

0 do not check

1 Serial check (root /)

2 parallel check (normal file system)

Mount at boot:

Yes ufs

No root file system swap virtual file system

Backup configuration file before modification

[root@solaris188:/] # cp / etc/vfstab / etc/vfstab.bak

Edit / etc/vfstab, add two lines at the end, and automatically mount / U01 and / software on boot

[root@solaris188:/] # vi / etc/vfstab add two lines

/ dev/dsk/c1t0d0s0 / dev/rdsk/c1t0d0s0 / U01 ufs 2 yes-

/ dev/dsk/c1t0d0s1 / dev/rdsk/c1t0d0s1 / software ufs 2 yes-

Mount confirmation using the mount command

[root@solaris188:/] # mount / u01

[root@solaris188:/] # mount / software

[root@solaris188:/] # df-h

Restart to view, / U01 and / software can be booted and mounted automatically

LV Xinghao

Lvxinghao@163.com

2016.1.8

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