Need help in scripting to do repair in format tool of Solaris


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help in scripting to do repair in format tool of Solaris
# 15  
Old 02-23-2017
Got it.
Can I give a range here ? Like repair from 39594646 to 585912500
In above example, it will repair only two blocks. I tried soemthing, didn't worked
Code:
# for i in {39594646..585912500}
> do
> echo $i
> /tmp/repair_sector $i
> done
{39594646..585912500}

format> Enter absolute block number of defect: `{39594646..585912500}' is not an integer.
Enter absolute block number of defect: `y' is not an integer.
Enter absolute block number of defect: Enter absolute block number of defect:
#

# 16  
Old 02-24-2017
In a bash shell you can test the argument expansion with
Code:
echo {39594646..585912500}

Likewise you can do
Code:
/tmp/repair_sector {39594646..585912500}

# 17  
Old 02-24-2017
I think, we missed something
Code:
# echo {39594646..585912500}
{39594646..585912500}
# /tmp/repair_sector {39594646..585912500}
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN300G cyl 46873 alt 2 hd 20 sec 625>
          /pci@0/pci@0/pci@2/scsi@0/sd@0,0
       1. c0t1d0 <SUN300G cyl 46873 alt 2 hd 20 sec 625>
          /pci@0/pci@0/pci@2/scsi@0/sd@1,0
Specify disk (enter its number): Specify disk (enter its number): selecting c0t0d0
[disk formatted]


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit
format> Enter absolute block number of defect: `{39594646..585912500}' is not an integer.
Enter absolute block number of defect: `y' is not an integer.
Enter absolute block number of defect: Enter absolute block number of defect:
#
# echo $SHELL
/sbin/sh
# 
# echo {seq 39594646......585912500}
{seq 39594646......585912500}
#

Not sure, but I am in failsafe mode, so may have limited features

Last edited by solaris_1977; 02-24-2017 at 12:28 PM..
# 18  
Old 02-24-2017
What's your shell? As MadeInGermany said, the {...} construct is available in (recent) bash.
And, to use seq as you want it to, deploy "command substitution" $(...).

EDIT: I see your shell is sh, so {...} won't work.
# 19  
Old 02-24-2017
There is normally no seq on Solaris.
Try to enter a bash shell with
Code:
/bin/bash

or
Code:
/a/bin/bash

# 20  
Old 02-24-2017
I mounted c0t1d0s0 on /a and included bash path in /tmp/repair_sector as #!/a/bin/bash
but no luck

Is there any other, I should do it in failsafe mode ?
# 21  
Old 02-25-2017
I meant you invoke the script from a bash shell.
Code:
# /bin/bash
bash# echo {39594646..585912500}

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

BART tool on Solaris 10 - enable SHA256

Hi all, I am attempting to create a BART manifest on a Solaris 10 box; however, I need it to be hashed with SHA256. Normally, at the beginning of a "bart create" command, the version and date appear along with the type of encryption listed. When I run the command though I receive the... (3 Replies)
Discussion started by: Derk Berk
3 Replies

2. Solaris

Question with Solaris Crash Analysis Tool with Solaris 9

Hello all. I am new hear and would like to ask a question regarding to the Solaris Crash Analysis Tool. We are analyzing the results of "thread summary" but not quite sure what the asterisk represents. Following are the items that asterisk were attached. 50* threads sleeping on a semaphore (49... (1 Reply)
Discussion started by: YuW
1 Replies

3. Solaris

Is there a similar tool with authconfig of Linux on Solaris?

Hi Dears, I believe you know authconfig on most of Linux Distributions. However, on Solaris OS, I don't know the similar tool. Could you please share me the tool, if any? Note: I am using SunOS 5.10. (0 Replies)
Discussion started by: crest.boy
0 Replies

4. Shell Programming and Scripting

Need a ksh scripting tool

Hi guys, I am new in Unix/linux field. I need a >>tool which is running on windows xp and provide the >>Korn shell scripting environment. As I used cygvin, but it is bash shell and most of the command of unix is not supported by cygwin.:confused: please suggest..... :) thanks in... (9 Replies)
Discussion started by: atul9806
9 Replies

5. Solaris

Can fssnap be used as a compression tool (Solaris 10)?

Friends, I am learning the working of fssnap command. Suppose there is a directory named /datadir which is of size 500mb. I had taken the snapshot by means of the following command: #fssnap -F ufs -o bs=/snapshotdir /datadir { it shows the o/p as /dev/fssnap/0 } My question is if... (2 Replies)
Discussion started by: saagar
2 Replies

6. Infrastructure Monitoring

Network monitoring tool for Solaris 10

Hi All, I was wondering if there is any Network Monitoring Tool for Solaris 10 to monitor a network having hybrid operating systems. I just googled it without success. Hope, experts will guide me to get it. Thanks, Deepak (7 Replies)
Discussion started by: naw_deepak
7 Replies

7. Solaris

Network monitoring tool for Solaris 10

Hi All, I was wondering if there is any Network Monitoring Tool for Solaris 10 to monitor a network having hybrid operating systems. I just googled it without success. Hope, experts will guide me to get it. Thanks, Deepak (0 Replies)
Discussion started by: naw_deepak
0 Replies

8. Shell Programming and Scripting

New tool for shell scripting

Hi All, It's quite long time....m comming to my favourite forum.. Can anyone suggest me good tool like eclipse for Java....do we have anything for Shell scripting..where n i can atlease prepare script...rather than typing all mistakes in Linux box :) Thanks Sha (1 Reply)
Discussion started by: Shahul
1 Replies

9. Solaris

Solaris Performance Monitoring Graphing Tool

Hi All Anyone out there using any graphing tool for Solaris performance data taken either through SAR utility or iosatat, vmstat, nicstat etc. There are a couple on googling like statsview and rrdtool but not sure if anyone is really happy and satisfied with using any of the graphing tool. ... (1 Reply)
Discussion started by: baner_n
1 Replies
Login or Register to Ask a Question