Create filesystem in Solaris (Veritas)

Creating RAW FS

# vxassist -g appdg make sybtempfs 2g user=sybase group=sybaseg
# newfs /dev/vx/rdsk/appdg/sybtempfs

Mounted FS

# vxassist -g appdg make sybtempfs 2g user=sybase15 group=sybase
# vxprint -ht | grep sybtempfs
v  sybtempfs    –            ENABLED  ACTIVE   4194304  SELECT    –        fsgen
pl sybtempfs-01 sybtempfs    ENABLED  ACTIVE   4194304  CONCAT    –        RW
sd paili01_11-02 sybtempfs-01 paili01_11 37748544 4194304 0       c2t50060E8003AAC711d9 ENA
# mkfs -F vxfs -o largefiles /dev/vx/rdsk/appdg/sybtempfs

create the mount point and mount the file system
# mkdir <mount point>
# mount -F vxfs /dev/vx/dsk/appdg/sybtempfs /apps/sybtemp

chown before and after mounting

change vfstab
/dev/vx/dsk/appdg/sybtempfs /dev/vx/rdsk/appdg/sybtempfs /apps/sybtemp vxfs 3 yes –

Filtered Deletion

Method 1

# ls -lrt | sed -n ‘/Sep 30/p’ | awk ‘{print $9}’ > sg1.tmp

# rm -rf `cat sg1.tmp`

########################
Method 2

# ls -lrt | sed -n ‘/Sep 30/p’ | awk ‘{print $9}’ | xargs rm

########################

Method 3:
(In current directory)

# find . -name ‘spam-*’ | xargs rm

or

# find . -name ‘*’ | xargs rm

Tar

To copy all of the files and subdirectories in the current working directory to the directory /target, use:

tar cf - * | ( cd /target; tar xfp -)

 
 

Create tar archive of file or folder

Tar -cvf /tmp/filename.tar /path/file

Include symbolic links

Tar -h -cvf /tmp/filename.tar /path/file

Create filesystem in Linux

1. Create the logical volume (devdba) with 2Gb size in volume group appvg.
# lvcreate -n devdba -L 2G appvg

2. Create the filesystem
# mkfs.ext3 /dev/appvg/devdba

3. Modify the fstab
# vi /etc/fstab

add this in /etc/fstab

/dev/appvg/devdba      /opt/devdba            ext3    defaults        1 2

4. Create the mount point and mount.
# mkdir /opt/devdba ; mount /opt/devdba

5. Modify ownership.
# chown oracle:dba /opt/devdba

Create filesystem in AIX

1. Create the logical volume (fslv01) using volume group (in this case datavg) with 1Gb size.
# mklv -y fslv01 -t jfs2 datavg 1G

2. Create the filesystem on the logical volume fslv01 with mount point /filesystem
# crfs -v jfs2 -d /dev/fslv01 -m /filesystem -A yes -p rw

3. Modify the ownership
# chown user:group /filesystem

4. Mount the filesystem and modify the ownership
# mount /filesystem ; chown user:group /filesystem

5. Verify permissions, also check with df filesystem is mounted.
# ls -ld /filesystem

drwxr-xr-x    3 user  group         256 Sep 16 13:07 /filesystem

Create filesystem with enabled large files. Here’s the syntax.

# mklv -y <lvname> -t jfs2 <volume group> <size>

# crfs -v  jfs2 -a bf=true  -d /dev/<lvname> -m /<mount_point> -A yes -p rw