How to correctly allocate size while creating FileSystem


 
Thread Tools Search this Thread
Operating Systems Solaris How to correctly allocate size while creating FileSystem
# 8  
Old 12-03-2007
Presumably there is a volume on slice 2 then?

It's not a good situation but nor is it game over yet, you've got two options, neither one is going to recover 100% of your data though sorry Smilie

Read the whole thing before you decide what to do - you have a few tough calls to make

Option 1: Forget the OS etc and try to save what was written to the volume on slice 2
Option 2: Forget what was written to the volume and slice 2 and try and save everything else.

If you need the data on slice 2, that makes option 1 preferable, if you need the data on one or more of the other slices, option 2 looks better.
If you have been using the volume on slice 2 heavily, you have a better chance of success with option 1
If you haven't filled the volume on slice 2 with much and havn't done lots of I/O on it, option 2 is likely to save more data.

It would probably be a good idea to get a second opinion on my suggested fix as it's going to do more damage to some of your data in an attempt to save other data. In other words, once you do this, there's no going back.

If you elect to go with option 2, try this:
  1. Start by booting off a cd or the network to get something we can work with
  2. Once you have a command prompt, try and mount /dev/dsk/c0t0d0s0 (or whever your root filesystem is) onto /a (this is available when booted off a cd for this purpose)
  3. If this fails reporting errors on the disk, run fsck over it - you'll lose a bit of data but hopefully not too much. Then try mounting again
  4. Go into /a/etc and edit the vfstab, comment out any volumes that are on slice 2 (look for 's2' in the device name)
  5. umount /a
  6. Run 'format' and select the disk that is damaged
  7. Display the partition table (I think it's 'p' 'p' from memory)
  8. Check that slice 2 starts at cylinder 0 and ends at the largest cylinder number possible - this step isn't vital but we might as well get things as normal as possible)
  9. If you have to make a change to do this, save the changes
  10. Exit out of format and back to the command prompt
  11. fsck /opt, /usr and /var - whichever of these are on seperate slices
  12. Attempt to boot from the disk
Any data written to the filesystem you created on slice 2 will be destroyed by doing this.

This won't be a silver bullet, most of the damage will not be reversable unfortunatly and the system may never boot again.
However, it might get the system bootable which will make restoring from backup much easier.

Whatever happens you should be looking at a total rebuild as soon as possible after this.

If you need that data on slice 2, option 1 is for you, try this:
  1. As in option 2, boot from a cd
  2. Attempt to mount slice 2 on /a
  3. If it fails, run fsck over that device and try again
  4. Run format and select this disk
  5. Edit the partition table and set the starting cylinder and size of all partitions _except slice 2_ to 0 (effectively deleting them)
  6. Save your changes and exit format
  7. Whatever you do, DO NOT attempt to boot from any part of this disk
This will destroy any surviving data on all slices other than 2.

Once you've got slice 2 salvaged, you can put the disk in another machine or install an OS on another disk in this machine.

It ain't gonna be fun, but never say die! Let us know how you get on and if you hit any issues, I'm sure we'll all offer all the help we can. In the end, it'll make a good story you can tell junior admins about the pitfalls of Solaris Smilie

Good luck!

[Edit] Are you comfortable with fsck and the basics of what it does? - If not, find out a bit about it first as it will make your decision easier.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Creating filesystem in LDOMs

Hi, I have a task of creating a UFS filesystem in an LDOM. It is located in a hypervisor (CDOM). The storage has been provisioned to the CDOM. How do I make it reflect to the LDOM, and then from there configure/set up the filesystem in the LDOM? Please help. (1 Reply)
Discussion started by: anaigini45
1 Replies

2. UNIX for Advanced & Expert Users

Physical disk IO size smaller than fragment block filesystem size ?

Hello, in one default UFS filesystem we have 8K block size (bsize) and 1K fragmentsize (fsize). At this scenary I thought all "FileSytem IO" will be 8K (or greater) but never smaller than the fragment size (1K). If a UFS fragment/blocksize is allwasy several ADJACENTS sectors on disk (in a ... (4 Replies)
Discussion started by: rarino2
4 Replies

3. Shell Programming and Scripting

How to get correctly directory size ?

Hello, I am on solaris 9 (KSH) and I am on trouble while using a command line in a script to get the directory size of a directory. /usr/bin/du -sk /data/_restit typeset -i rep_size=` /usr/bin/du -sk /data/_restit |cut -d"/" -f1 ` echo "${rep_size}" I did try different way to write the... (6 Replies)
Discussion started by: Aswex
6 Replies

4. Programming

SIGSEGV when allocate a certain size

The problem: I need to work with large arrays and after one of my structures grew in size my program started getting segmentation fault. My code where I allocate the arrays: static R1 *tarr; static R2 *rarr; proc_init_mem() { const int t_sz = sizeof(R1) *... (9 Replies)
Discussion started by: migurus
9 Replies

5. Linux

Creating Filesystem using DD for LVM

I created a new filesystem using dd and mounted: I have a filesystem /FAW with 1Terra space /dev/sdb1 1151331444 24742604 1068104612 3% /FAW Steps I followed to create a new filesystem # dd if=/dev/zero of=/FAW/vms/linux_vm/disk2.img bs=1 count=1024 seek=500G # mke2fs... (10 Replies)
Discussion started by: sriram003
10 Replies

6. Red Hat

Creating filesystem on new LUN

I'm new to linux and need information on how do I create a filesytem on a dedicated on LUN for RHEL 4 and 5? I want the filesystem to be a ext3 ---------- Post updated at 10:00 AM ---------- Previous update was at 08:56 AM ---------- Found the answer. This thread can be closed. (1 Reply)
Discussion started by: soupbone38
1 Replies

7. Filesystems, Disks and Memory

Creating filesystem of 2MB size

Hi all, I would like to ask on how to create 2MB partition on a Compact Flash card. It supposed to be of FAT12 type, and the CF capacity is 4GB. I try to do the partitioning and specify the size as 2MB but the partition editor automatically resize it to 8MB. I know that this is possible and the... (4 Replies)
Discussion started by: archayl
4 Replies

8. Solaris

creating new filesystem

# df -h Filesystem size used avail capacity Mounted on /dev/dsk/c1d0s0 4.5G 4.3G 129M 98% / /devices 0K 0K 0K 0% /devices ctfs 0K 0K 0K 0% /system/contract proc 0K 0K ... (4 Replies)
Discussion started by: seyiisq
4 Replies

9. AIX

filesystem size

i am new in the field 3months to be precise. how do i come up with size, i want to change for the filesystem? assuming there is enough space on the volume group. do i just assign any value? (5 Replies)
Discussion started by: freeman
5 Replies

10. AIX

Creating a shared filesystem

Hi everybody, Is it possible to create a Shared Filesystem on Network to be accessed from 2 Systems? Both systems are AIX but with different versions. One of these systems is AIX 4.3 & the other is AIX 5.2. Thanks in advanced (8 Replies)
Discussion started by: aldowsary
8 Replies
Login or Register to Ask a Question