Repartitioning with format: bad superblock produced

Hi everybody,

i wanted to increase the size of my / partition in solaris 9.

The partition table had the following entries, among others:

PartTagFlagCylSizeBlocks

0rootwm363-16101.72GB1248/0/03605472

2backupwm0-2461933.92GB24620/0/0 71127180

7homewm1611-2468 31.70GB23008/0/0 6647112

# First question: is backup always covering all the disk?

# Now i want to reduce the size of home.

# I will cut the first cylinders and start it from cyl 3800.

# Then i just typed:

format

0# this was the disk selection

partition

7# this is partition home, as in table above

Enter partition id tag[home]:

Enter partition permission flag[wm]:

Enter new starting cyl[1611]: 3800

Enter partition size: 28.68gb

label

Ready to label disk, continue? y

print

# below only the partitions under interest ...

PartTagFlagCylSize

0rootwm363-16101.72GB

7homewm3800-21936 28.68GB

# now i want to use the gigas made free in the / partition.

# So i continued from the same point as above ... (the partition prompt)

0# this selects the / partition

Enter partition id tag[root]:

Enter partition permission flag[wm]:

Enter new starting cyl[363]:

Enter partition size: 3437c

# here i calculated the size from the first root cyl (363) to the first home cyl (3800).

# Continuing ...

label

Ready to label disk, continue? y

print

# below only the partitions under interest ...

PartTagFlagCyl Size

0rootwm363-37994.7GB

7homewm3800-2193628.68GB

quit

quit

reboot

# the boot stoped in fsck with the message:

/dev/rdsk/c1t2d0s7: BAD SUPERBLOCK AT 16: MAGIC NUMBER WRONG

/dev/rdsk/c1t2d0s7: USE AN ALTERNATIVE SUPERBLOCK TO SUPLY NEEDED INFORMATION

/dev/rdsk/c1t2d0s7: e.g. fsck -F ufs -o b=# [special ...]

/dev/rdsk/c1t2d0s7: where # is the alternative superblock

# It seems that Solaris complains only with the /export/home partition, which had its size reduced,

# but not with the / partition, which was increased.

# ? I do not know what i have to give as superblock. Any help ?

# Thanks enormously for a help!

[2294 byte] By [tunelera] at [2007-11-27 0:37:03]
# 1

format is not designed to change the size of filesystems.

It just edits the partition table.

So you just created an invalid filesystem.

Solaris in fact doesnt have a simple tool for resizing filesystems.

growfs can expand them, but is normally used in conjunction with svm and it can't be used on the root fs.

Theres no tool available to shrink filesystems.

The / filesystem that you just extended should be ok (or at least not corrupt).

Except that it won't see the new space.

As far as /export/home goes,

If you know the previous settings, change it back and reboot and if your really lucky, your filesystem will be intact.

If not, you can newfs /export/home. But you're probably better off reinstalling the system and picking a more appropriate size for /

In genrnal, the easiest way to get some extra space in / is to pick a biggish directory like /var,

copy it only /export/home and symlink it back the original location.

robert.cohena at 2007-7-11 22:46:48 > top of Java-index,General,Sys Admin Best Practices...
# 2

Ok,

# now i am trying to change to the old partition table and get the message:

"Cannot label disk while it has mounted partitions".

# I wrote

sh

NOINUSE_CHECK=1

export NOINUSE_CHECK

# and tried again. No success and the same message.

Another question: if i symlink the /usr directory, now inside

the / partition, to inside /export/home, does it bring possible problems?

Tanks

tunelera at 2007-7-11 22:46:48 > top of Java-index,General,Sys Admin Best Practices...
# 3
I doubt if you can safely symlink /usr, its too crucual to the system.
robert.cohena at 2007-7-11 22:46:48 > top of Java-index,General,Sys Admin Best Practices...
# 4

> I doubt if you can safely symlink /usr, its too

> crucual to the system.

Most importantly, it can't be symlinked to an unmounted filesystem (like /export).

/usr must be mounted early in the boot. So its only choices are to exist within / or to be a separate filesystem which the startup scripts will explicitly mount. Any /usr symlink would fail until /export was mounted, and that won't happen until long after /usr is needed.

--

Darren

Darren_Dunhama at 2007-7-11 22:46:48 > top of Java-index,General,Sys Admin Best Practices...
# 5

Hi all,

i reset back to the original partition table. I had to boot from cdrom in single

user mode to do that, since exporting the variable NOINUSE_CHECK was

not working.

I will then symlink /usr/local and /var to /export/home.

Are you sure moving /var is ok?

A simple command `cp -pr /var /export/home/var` freezes.

It seems to freeze in the directory /var/sadm/wbem/snmp/map

when transfering the fifo files:

# file /var/sadm/wbem/snmp/*

/var/sadm/wbem/snmp/_adapter_rcv.fifo: fifo

/var/sadm/wbem/snmp/_adapter_snd.fifo: fifo

Should i break /var into pieces and transfere only part of it to /export/home?

Thanks ...

tunelera at 2007-7-11 22:46:48 > top of Java-index,General,Sys Admin Best Practices...
# 6

> Hi all,

> i reset back to the original partition table. I had

> to boot from cdrom in single

> user mode to do that, since exporting the variable

> NOINUSE_CHECK was

> not working.

>

> I will then symlink /usr/local and /var to

> /export/home.

> Are you sure moving /var is ok?

No. /var also mounts before non-OS filesystems.

If you boot to single-user mode, /, /usr, /var, /var/adm, and /var/run should all be accessible either as subdirectories or as separate mount points.

If you symlink it to some other filesystem, then that filesystem won't yet be mounted and these directories will not be accessible.

> A simple command `cp -pr /var /export/home/var`

> freezes.

> It seems to freeze in the directory

> /var/sadm/wbem/snmp/map

> when transfering the fifo files:

> # file /var/sadm/wbem/snmp/*

> /var/sadm/wbem/snmp/_adapter_rcv.fifo: fifo

> /var/sadm/wbem/snmp/_adapter_snd.fifo: fifo

Don't use 'cp'. Use 'tar' or 'cpio'.

--

Darren

Darren_Dunhama at 2007-7-11 22:46:48 > top of Java-index,General,Sys Admin Best Practices...