Today we compare Solaris and Linux.
Which steps are required to create filesystems on a new virtual disk?
a) Linux
Here we are on a Redhat 10 system
[root@red10]# uname -ro
6.12.0-211.29.1.el10_2.x86_64 GNU/Linux
We have a new unused disk
[root@red10]# lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sdb 8:16 0 2G 0 disk
First we have to initialize the disk
[root@red10]# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created.
and then create a Volume Group
[root@red10]# vgcreate datavg /dev/sdb
Volume group "datavg" successfully created
Now a Logical Volume
[root@red10]# lvcreate -n data1 -L1g datavg
Logical volume "data1" created.
[root@red10]# mkfs.xfs /dev/mapper/datavg-data1
meta-data=/dev/mapper/datavg-data1 isize=512 agcount=4, agsize=65536 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=1
= reflink=1 bigtime=1 inobtcount=1 nrext64=1
= exchange=0 metadir=0
data = bsize=4096 blocks=262144, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1, parent=0
log =internal log bsize=4096 blocks=16384, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
= rgcount=0 rgsize=0 extents
= zoned=0 start=0 reserved=0
And finally we create a directory and mount the new filesystem
[root@red10]# mkdir /mydata
[root@red10]# mount /dev/mapper/datavg-data1 /mydata
To mount the filesystem automatically at boot we have to
add it to fstab
[root@red10]# blkid /dev/mapper/datavg-data1
/dev/mapper/datavg-data1: UUID="7fd552b2-1f10-4b87-bcc8-f22a22fc1f6c" BLOCK_SIZE="512" TYPE="xfs"
[root@red10]# echo 'UUID=7fd552b2-1f10-4b87-bcc8-f22a22fc1f6c /mydata xfs defaults 0 0' >>/etc/fstab
b) Solaris
We are on a Solaris 11 system
root@vbox-cbe:~# uname -ro
5.11 Solaris
We have a new disk
root@vbox-cbe:~# echo | format | grep c1t3
c1t3d0: configured with capacity of 2.00GB
1. c1t3d0 <VBOX-HARDDISK-1.0-2.00GB>
With zfs we use one command to initialize the disk.
root@vbox-cbe:~# zpool create mypool c1t3d0
After this step, we already have a first
mounted filesystem to use.
root@vbox-cbe:~# zfs list mypool
NAME USED AVAIL REFER MOUNTPOINT
mypool 98.5K 1.95G 31K /mypool
It is easy to create additional filesystems
root@vbox-cbe:~# zfs create -o mountpoint=/mydata mypool/mydata
root@vbox-cbe:~# zfs list -r mypool
NAME USED AVAIL REFER MOUNTPOINT
mypool 149K 1.95G 31K /mypool
mypool/mydata 31K 1.95G 31K /mydata
Summary
On Solaris a new filesystem is created with only 2 commands
compared to 8 commands on Linux.
Easy to understand why I prefer Solaris and ZFS
No comments:
Post a Comment