Sponsored Content
Operating Systems Solaris How to check at which drive root FS is? Post 302602334 by sunadmin on Monday 27th of February 2012 05:05:28 AM
Old 02-27-2012
MySQL

Hi nypreH,

Boot the system from cdrom in single user mode:

Code:
ok> boot cdrom -s
# cd /

If you are not sure what your boot-device is, run format to list the disks in the system.

Code:
# format
Searching for disks...done

AVAILABLE DISK SELECTIONS:

      0. c1t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
         /pci@1f,700000/scsi@2/sd@0,0
      1. c1t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
         /pci@1f,700000/scsi@2/sd@1,0

 Specify disk (enter its number):

Hit control-D to exit. Based on the above output, we'll assume c1t0d0 is our boot-device.

Perform a sanity check on slice 0 and verfiy the ufs type:

Code:
# fstyp /dev/rdsk/c1t0d0s0
ufs

Mount the filesystem read-only:

Code:
# mount -o ro /dev/dsk/c1t0d0s0 /a

Verify it is indeed the boot disk by looking at the contents of /a

Code:
# ls -l /a

total 12228
lrwxrwxrwx   1 root     root           9 Oct 19  2004 bin -> ./usr/bin
drwxr-xr-x   3 root     nobody       512 Mar 23 14:35 cdrom
drwxr-xr-x  14 root     sys         4096 Mar 23 15:05 dev
drwxr-xr-x   6 root     sys          512 Nov  2 19:30 devices
drwxr-xr-x  59 root     sys         4096 Apr 21 20:02 etc
drwxr-xr-x   2 root     sys          512 Oct 19  2004 export
dr-xr-xr-x   1 root     root           1 Apr  6 17:38 home
drwxr-xr-x  10 root     sys          512 Oct 19  2004 kernel
lrwxrwxrwx   1 root     root           9 Oct 19  2004 lib -> ./usr/lib
drwx------   2 root     root        8192 Oct 19  2004 lost+found
drwxr-xr-x   2 root     sys          512 Oct 19  2004 mnt
...
...
[output truncated]

If your output looks like this, you can assume it is your boot-device.

Next: Inspect your vfstab

Code:
# cat /a/etc/vfstab

Look for the line that has a single '/' in the third column.
It looks like the following -
/dev/dsk/c1t0d0s0       /dev/rdsk/c1t0d0s0      /       ufs     1       no      -

Then you can go ahead and unmount the filesystem again, and run fsck to ensure the filesystem is in a clean state:

Code:
# cd /

# umount /a

# fsck -F ufs -y /dev/rdsk/c1t0d0s0

Now it's safe to mount the filesystem in read-write mode:

Code:
# mount -o rw /dev/dsk/c1t0d0s0 /a

Now copy the bootblock back to the disk:

Code:
# /usr/sbin/installboot /a/usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t0d0s0

Once this is done, reboot:

Code:
# reboot

Moderator's Comments:
Mod Comment Please use code tags
 

10 More Discussions You Might Find Interesting

1. Programming

check root password

hai Friends How can i check the root password of a linux system using a c program or with some shell script... I have seen many tools like webmin that authenticates the user using the root password... How do they do that... Pls help... Thanks in advance Collins (1 Reply)
Discussion started by: collins
1 Replies

2. AIX

Check for media in DVD drive

I would like to check for the existance of media in a DVD drive prior to running a mkcd. Is this possible? I have accomplished this in the past with tctl, but that was with a tape drive. Any help is appreciated. Thanks (0 Replies)
Discussion started by: dmjoen
0 Replies

3. Solaris

how to ufsrestore root drive then activate disksuite

I restored a backup of a root drive to a new disk on Solaris 8 which contained a fully functioning disksuite 4.2.1 mirror configuration. The backup is from an identical system and OS. I want to install a second identical disk and recover the mirror configuration. The root disk is up but... (2 Replies)
Discussion started by: csgonan
2 Replies

4. Solaris

Cloning the root drive - Help Plz

I use Sunfire V480R , and i am seeing lot of scsi transport errors for the root drive & i think it is going to die . the system is having 2 drives & the second drive is kept unused . can someone guide me how do i clone the root drive to the seconddrive and make that bootable . (13 Replies)
Discussion started by: skamal4u
13 Replies

5. Shell Programming and Scripting

Bourne script: Check for root and oracle user

I have 2 separate Bourne shell scripts with 2 questions in Sun O/S & UNIX environment. Question 1: One of the scripts is supposed to be executed by "root" user only but cannot be executed after user executes "su - oracle". How can I check in the script whether the current user is "root" user?... (8 Replies)
Discussion started by: totziens
8 Replies

6. UNIX for Dummies Questions & Answers

dvd in drive how to check

is there some tools(not graphical) command to reconnoiter what kind of cd/dvd is on drive (dvd+rw/dvd-rw/etc)? (1 Reply)
Discussion started by: vikus
1 Replies

7. Solaris

safeguarding root drive

I have root drive which i want to guard against possible hard disk loss. How can backup and restore the all user created , filesystem , mount points , meta devices if at all there be hdd failure . Any pointer to good document would be good help . Ours is solaris 8 . (1 Reply)
Discussion started by: Hitesh Shah
1 Replies

8. Shell Programming and Scripting

Root owns removable drive and rsync won't work

I'm using rsync to back up to a usb key rsync -r -t -v -a /home/pc/AGS/ /media/DIESEL/pc/AGS/ It worked fine for a long time, and then not so good. Running from the command line there are a lot of complaints about 'can't chgrp ...'. It's formatted to fat32 so I can read it in all kinds of... (0 Replies)
Discussion started by: triplemaya
0 Replies

9. UNIX for Dummies Questions & Answers

Check tape drive status on HP-UX

Hi all, We have an ESL tape library with legato networker software. From GUI - networker administrator, i can see that 3 of our tape drives are in service mode. How can i view the same thing by issuing commands in HP-UX. Thanks in advance! (1 Reply)
Discussion started by: *Jess*
1 Replies

10. Ubuntu

Cannot access or boot encrypted drive (gave up waiting for root device...)

I cannot access or boot from my C drive. I'm running Zorin 9 and the drive is a Samsung SSD. The disk was encrypted on install, and that has not given me any problems before. When I start the system it gets to the memory test page, and does not then load the password prompt, which it used to.... (1 Reply)
Discussion started by: David4321
1 Replies
All times are GMT -4. The time now is 04:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy