Script to scan the disks and make file system


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to scan the disks and make file system
# 8  
Old 10-26-2017
Code:
 grep -q "^[^#]*/dev/$b\>" /etc/fstab && continue
  uuid=$(blkid -s UUID -o value /dev/$b)
  # jump to next loop cycle if its UUID is present and in fstab
  [ -n "$uuid" ] && grep -q "^[^#]*$uuid" /etc/fstab && continue
  # echo -e is discouraged, the echo options can differ between shells

what do the above lines do and what if the disk are partioned with lvm and mounted in the below format
Code:
/dev/mapper/vg_lv_home /home                 
/dev/mapper/vg_lv_tmp /tmp                   
/dev/mapper/vg_lv_u01 /u01


Last edited by rbatte1; 10-27-2017 at 08:33 AM.. Reason: Code tags for list of required format
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Scan for new LUN and create a new file system

Hi Please I dont have a lot of redhat skills, but I need some help on creating a file system. I need to rescan for this new LUN, so I try to check existing LUNs: fdisk -l Disk /dev/sda: 299.4 GB, 299439751168 bytes 255 heads, 63 sectors/track, 36404 cylinders Units = cylinders of... (8 Replies)
Discussion started by: fretagi
8 Replies

2. Shell Programming and Scripting

Make 48 disks(files) on solaris 10

Hello, to simulate an environment with 48 disks using Solaris 10 x86, i try toMake 48 disks (files) with MKFILE : #for i in c{0,1,2,3,4,5}t{0,1,2,3,4,5,6,7}d0 >do > mkfile 100m $i >done But i received like result : #ls /test_zfs c{0,1,2,3,4,5}t{0,1,2,3,4,5,6,7}d0 Any help... (2 Replies)
Discussion started by: herbich1985
2 Replies

3. UNIX for Advanced & Expert Users

Scan all mail messages through the server and save a copy into file system following a rule

In our company we work for our customer with a job# philosophy, managing all the informations about a job in a share with directories whose name is starting with job number. Under this entry point we have a standard structure of folders, comprising a "communications" folder. When we send emails... (0 Replies)
Discussion started by: vroby67
0 Replies

4. UNIX for Advanced & Expert Users

how to make a full system backup excluding data and restoring it to a new system

Hi, In order to have a sand box machine that I could use to test some system changes before going to production state, I'd like to duplicate a working system to a virtual one. Ideally, I'd like to manage to do it this way : - Make a full system backup excluding the user file system (this... (7 Replies)
Discussion started by: pagaille
7 Replies

5. Fedora

Read only disks on Linux system

Hi guys I have a SSL server that is running Fedora 9. I wanted to create a directory but get: mkdir: cannot create directory `test': Read-only file system Any ideas? (4 Replies)
Discussion started by: wbdevilliers
4 Replies

6. Shell Programming and Scripting

Shell Script to continuously scan a log file

Hello members, I have some doubts on how to write a script that can reports success / failure of a batch job ? 1. Run a batch job: 2. Wait and search for a particular string in the Log file: tail -f log01*.txt | egrep -v "^SUCCESSFUL" echo "continue with the other tasks" ... (1 Reply)
Discussion started by: novice82
1 Replies

7. UNIX for Advanced & Expert Users

Using newfs to make file system on a sata disk using Acard adaptor

Hi All: I am using an adaptor between a 1TB SATA hard drive and solaris 8 box with 68 pin scsi. I use the format utility to partition the HD which works fine but when I use newfs, I get some errors. I will place them below. I have blocked and the error message is in red. Anybody got any... (1 Reply)
Discussion started by: mndavies
1 Replies

8. AIX

system disks on aix 5.3

hello i'm running on P570 box aix 5.3 8 cpus 24G ram there are 1850 users loged in to this box the problem is that the two sysytem disks busy all the time hdisk0 100% busy hdisk1 100% busy some one have an idea what writing to this disks? thanks ariec (9 Replies)
Discussion started by: ariec
9 Replies

9. UNIX for Dummies Questions & Answers

How To Make Stealth Scan

hi all can anybdy plz tell me how to make a stealth port scan in unix c. if i want to send *just* ack/fin etc how do i send? using libnet or what? thankx (7 Replies)
Discussion started by: ambar
7 Replies
Login or Register to Ask a Question
dtc_kill_vps_disk(8)					      System Manager's Manual					      dtc_kill_vps_disk(8)

NAME
dtc_kill_vps_disk - destroy LVM disks for freeing space SYNOPSIS
dtc_kill_vps_disk VPS_NUMBER [ lvm|loopback ] DESCRIPTION
dtc_kill_vps_disk This shell script is a part of the dtc-xen package that is to be used by the dtc panel to manage a Xen VPS server. This script is used to delete a partitions that was used by a VPS. It will delete the normal partition that was used as a root disk, and the swap partition. dtc_kill_vps_disk is to be used by the dtc-xen SOAP server, but can also be used as a standalone userland tool. OPTIONS
VPS_NUMBER has to be a number between 01 and 19. Let's say the number is 16, and that dtc-xen is configured to use the volume group called lvm1, then this script will create /dev/lvm1/xen16 and /dev/lvm1/xen16swap. IMAGE_TYPE This parameter can have 2 values: either lvm or loopback. If ommited, then lvm is used. If lvm is used, then this script will create a partition using lvmcreate, otherwise it will create an image file. Both will later be used for the VPS. EXAMPLE
dtc_setup_vps_disk 04 lvm This will delete the 2 LVM partitions that were used by the VPS named xen04, the first one being the root partition, and the second one being the swap partition. VERSION
This documentation describes dtc_kill_vps_disk See http://www.gplhost.com/software-dtc-xen.html for updates. SEE ALSO
dtc_reinstall_os(8), dtc_setup_vps_disk(8) dtc_kill_vps_disk(8)