solaris硬盘挂载

本文详细记录了在SUN Solaris系统中,为T5120服务器的zone添加硬盘的过程。首先通过`df`命令确认当前使用的硬盘,然后使用`format`命令查看并选择未使用的硬盘c1t1d0。接着,进入分区模式,修改分区表,创建新的分区,并分配100GB空间。之后,使用`newfs`创建文件系统,并通过`mount`命令将新分区挂载到/export目录下,完成硬盘挂载。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

solaris硬盘挂载
给一台安装了solaris系统的T5120划分zone的时候,由于系统所在的磁盘空间不足,所以需要将另外一块闲置的 硬盘进行挂载,以下是我的挂载过程。

先使用df查看系统现在在使用的是那个硬盘,在使用的盘是:c1t0d0
运行下面的命令查看 磁盘信息:
bash-3.00# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c1t0d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
/pci@0/pci@0/pci@2/scsi@0/sd@0,0
1. c1t1d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
/pci@0/pci@0/pci@2/scsi@0/sd@1,0
Specify disk (enter its number):1
selecting c1t1d0
有两块磁盘,其中c1t0d0已经使用,需要挂载的是c1t1d0这块硬盘。
format> p /进入分区模式/

PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!<cmd> - execute <cmd>, then return
quit
partition> p /显示磁盘现有分区情况/
Current partition table (default): Total disk cylinders available: 14087 + 2 (reserved cylinders)
Current partition table (original):
Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 10304 129.19MB (10305/0/0) 209727360
1 swap wu 10305 - 14086 129.19MB (3782/0/0) 76971264
2 backup wu 0 - 14086 136.71GB (14087/0/0) 286698624
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 0 136.46GB (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0 partition> m /修改分区/
Select partitioning base:
0. Current partition table (default)
1. All Free Hog
Choose base (enter number) [0]? 1

Part Tag Flag Cylinders Size Blocks
0 root wm 0 0 (0/0/0) 0
1 swap wu 0 0 (0/0/0) 0
2 backup wu 0 - 14086 136.71GB (14087/0/0) 286698624
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0

Do you wish to continue creating a new partition
table based on above table[yes]? Yes
Free Hog partition[6]? 1
Enter size of partition '0' [0b, 0c, 0.00mb, 0.00gb]: 100gb /分一个100G的卷/
Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '4' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '5' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '6' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '7' [0b, 0c, 0.00mb, 0.00gb]:

Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 10304 100.01GB (10305/0/0) 209727360
1 swap wu 10305 - 14086 36.70GB (3782/0/0) 76971264
2 backup wu 0 - 14086 136.71GB (14087/0/0) 286698624
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0

Okay to make this the current partition table[yes]? Yes
partition>quit


# newfs /dev/dsk/c1t1d0s1 /建文件系统/
newfs: construct a new file system /dev/rdsk/c1t1d0s1: (y/n)? y
………..

# mount /dev/dsk/c1t1d0s1 /export /挂载到export目录下/
# ls
bak dev export lib net platform sbin tmp vol
bin devices home lost+found opt proc swapfile usr export
cdrom etc kernel mnt oss root system var
# df
Filesystem size used avail capacity Mounted on
/dev/dsk/c1t0d0s0 29G 5.3G 23G 19% /
/devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 26G 1.4M 26G 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
/platform/SUNW,SPARC-Enterprise-T5120/lib/libc_psr/libc_psr_hwcap2.so.1
29G 5.3G 23G 19% /platform/sun4v/lib/libc_psr.so.1
/platform/SUNW,SPARC-Enterprise-T5120/lib/sparcv9/libc_psr/libc_psr_hwcap2.so .1
29G 5.3G 23G 19% /platform/sun4v/lib/sparcv9/libc_psr.so.1
fd 0K 0K 0K 0% /dev/fd
swap 26G 1.2M 26G 1% /tmp
swap 26G 88K 26G 1% /var/run
/dev/dsk/c1t1d0s0 98G 3.3G 94G 4% /export /* mount 上来的卷*/
可以使用以下的命令来查看mount上来的空间大小
df -h | grep /export
/dev/dsk/c1t1d0s0 98G 3.3G 94G 4% /export

That’s over!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值