Hi
What I'm trying to do(manually) is logging into the server
and running the below mentioned commands
so i have to do this on multiple machines logging into each machine
scanning for new disk where the disk may be any (/dev/sdg /dev/sdb or /dev/sdi like wise but the newly added disk will be of 6G
so though of writing simple shell script but a little mistake can mess up the whole thing here i need to partition only the disk which i have scanned and has been added recently otherwise i may loose the data
i thought of something like this
First of all, you cannot check enough, or you risk to damage existing file systems!
Suggestion for a script
Then pass this script ("scan_add_fstab.sh") to /bin/bash on each server
This User Gave Thanks to MadeInGermany For This Post:
At first glance, it appears that as long as all files in the directory /sys/class/scsi_device are directories, they should produce similar results. If a file in that directory is not a directory, the 1st script will get an error trying to write to an invalid pathname while the 2nd script will silently ignore any files that are not directories.
In both cases, the scripts make the assumption that every directory in that directory has a subdirectory named device and that the user running the script has permission to create or overwrite a file named rescan in that subdirectory.
In the 2nd script, the shell reads the directory to get the list of files to process and then processes the files found in that list. In the 1st script, ls must be invoked to get the list of files but ls and the rest of the script can run in parallel.
As MadeInGermany said, neither of these demonstrate what would be called production code.
And, knowing that we must never create new files in /sys, the following is more consequent
--
The ls command truncates the given path. Can be useful, but in the while loop one needed to add it again.
Just one more caveat: if your shop is similar to my customer you have to deal with several versions of several Linux distributions. I am no expert for Linux by any stretch, but i remember older Linux distributions didn't have that /sys-tree but files in /dev to deal with devices.
I don't know when this changed (as i said, i don't work regularly with Linux) but if there is any chance you might hit such a system you should perhaps put some safety test of the version you are running on in there prior to such a deep-impact procedure.
The purpose of /sys is to give some insight into the kernel memory. Typically you can read (and patch) kernel parameters here. But also device drivers can plug in, so you can set their properties.
Sounds like /proc? Indeed the implementation of /sys is similar, and at the beginning they (mis)used the /proc for kernel parameters.
The /dev tree is still for the main functionality: give the user land a file-like interface, and handle it with device drivers in the kernel.
Of cause many parameters in /sys and /proc have little drivers that present the binary kernel values as text (and in the case of writing/patching convert the text to binary).
And yes, /sys sometimes changes. One should carefully check the existing /sys structure when using it; that's better than making asssumptions because of a certain OS version.
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)
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)
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)
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)
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)
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)
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)
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)
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)