Solaris 8 format command

Can you change the size of an existing slice? I need to change partition 5 from 4.00GB to 8.00GB. Partition 6 is not in the vfstab file.

Disk 0: Partition 6, Filesystem: /u02

partition> print

Current partition table (original):

Total disk cylinders available: 24620 + 2 (reserved cylinders)

PartTagFlagCylinders SizeBlocks

0rootwm0 - 29034.00GB(2904/0/0)8389656

1varwm2904 - 50813.00GB(2178/0/0)6292242

2backupwm0 - 2461933.92GB(24620/0/0) 71127180

3swapwu5082 - 72593.00GB(2178/0/0)6292242

4 unassignedwm7260 - 101634.00GB(2904/0/0)8389656

5 unassignedwm10164 - 13067 4.00GB(2904/0/0)8389656

6 unassignedwm13068 - 1311364.89MB(46/0/0)132894

7 unassignedwm00 (0/0/0)0

Can partition 6 be set back to 0 Clyinders and 0 Size, then change partition 5 size to 8.00GB?

I could then restore partition 5's filesystem from backup.

[930 byte] By [seaward_dba] at [2007-11-26 10:42:52]
# 1

It looks like you are only using about 19 gig out of a 36 gig drive (33 formatted).

You can partition slice 6 using 8 gig of the remaining approx 13 gig of hard drive space and leave slice 5 the way it is.

Do a label and a newfs on slice 6.

Then mount slice 6 to /mnt and do a ufsdump/ufsrestore from slice 5 to slice 6.

Unmount /mnt

change the /etc/vfstab to mount slice 6 instead of slice 5 on next reboot.

Or you could do it the way you asked. You must first backup the data and unmount slice 5.

Then do a format and create slice 5 the way you want it and label the disk.

mount slice 5 again and restore from backup.

This will only work with consecutive slices, and unmounted filesystems.

Either way will work.

mlhardwicke at 2007-7-7 2:54:48 > top of Java-index,General,Sys Admin Best Practices...
# 2

> Can you change the size of an existing slice?

Yes. You can modify any slice in format.

I need

> to change partition 5 from 4.00GB to 8.00GB.

*changing* the slice in format is easy. What you have to do is ensure that the cylinders that you reference in the slice make sense. For instance, you don't want to have multiple slices reference the same data.

> ootwm0 - 29034.00GB(2904/0/0)

>8389656

> 1varwm2904 - 50813.00GB

>(2178/0/0)6292242

> backupwm0 - 2461933.92GB

>(24620/0/0) 71127180

> swapwu5082 - 72593.00GB

>(2178/0/0)6292242

> unassignedwm7260 - 101634.00GB

>(2904/0/0)8389656

> unassignedwm10164 - 13067 4.00GB

>(2904/0/0)8389656

> unassignedwm13068 - 1311364.89MB

>(46/0/0)132894

> unassignedwm00

> (0/0/0)0

> tition 6 be set back to 0 Clyinders and 0 Size, then

Sure. As long as you don't need the data that's currently in the slice.You might run 'fsck -n /dev/rdsk/cxtxdxs6' just to verify if it's a filesystem and where it was last mounted.

> change partition 5 size to 8.00GB?

Well, you can't simply change it to 8. There's not enough room left where it is. If you could get rid of slice 4 as well, then there would be room. But 'format' doesn't show you if the data is in use or not.

> I could then restore partition 5's filesystem from

> backup.

--

Darren

Darren_Dunham at 2007-7-7 2:54:48 > top of Java-index,General,Sys Admin Best Practices...
# 3

Since slice 6 is the last one physically on the disk and you have adjacent space to grow into, you are actually in luck.

You should be able to unmount it.

Change the partition map using format.

Then run growfs to expand the filesystem.

Note that this isnt strictly a supported operation.

If you screw it up, your pretty much on your own.

I would recommend taking a backup first.

Sun would recommend that you use a volume manager like SVM to concat the extra space on.

But since its the last partition on disk and you have the adjacent space to grow into, it should work.

robertcohen at 2007-7-7 2:54:48 > top of Java-index,General,Sys Admin Best Practices...
# 4

> Since slice 6 is the last one physically on the disk

> and you have adjacent space to grow into, you are

> actually in luck.

Yeah, but slice 6 is tiny. He mentioned growing slice 5 from 4 to 8 GB. He'd probably need to use the space from slice 4 for that. And if he did, he'd have to move the filesystem because the start cylinder would change....

--

Darren

Darren_Dunham at 2007-7-7 2:54:48 > top of Java-index,General,Sys Admin Best Practices...
# 5

There is still space left on the device.

Part Tag Flag Cylinders Size Blocks

0 root wm 0 - 2903 4.00GB (2904/0/0) 8389656

1 var wm 2904 - 5081 3.00GB (2178/0/0) 6292242

2 backup wm 0 - 24619 33.92GB (24620/0/0) 71127180

3 swap wu 5082 - 7259 3.00GB (2178/0/0) 6292242

4 unassigned wm 7260 - 10163 4.00GB (2904/0/0) 8389656

5 unassigned wm 10164 - 13067 4.00GB (2904/0/0) 8389656

6 unassigned wm 13068 - 13113 64.89MB (46/0/0) 132894

7 unassigned wm 0 0 (0/0/0) 0

The cylinders can go as high as 24619, but slice 6 ends at cylinder 13113. There is still more space left on the drive.

slice 0 is 4gb, slice 1 is 3gb, swap is 3gb, slice 4 is 4gb, slice 5 is 4gb, and slice 6 is not even a gig. This leaves about 13 gig to play with.

Formatting the drive to increase the size to 8 gig should be no problem.

mlhardwicke at 2007-7-7 2:54:48 > top of Java-index,General,Sys Admin Best Practices...
# 6

Thanks for the replies.

I plan to use the safest method since this is a production system. Change slice 6 to 8G, create a new filesystem and copy directories from slice 5 to 6 new filesystem.

But I may have a new problem. When I ran fsck -m /dev/rdsk/c0t0d0s6 to check slice 6 I received "BAD SUPER BLOCK: MAGIC NUMBER WRONG"

To start with I am not sure how or who assigned slice 6 with 64.89MB of space. There are no filesystems assigned to slice 6 as shown from a df command. Should I set the cylinders start and end back to zero or just change to 8Gig?

Any Help or Precautions?

seaward_dba at 2007-7-7 2:54:48 > top of Java-index,General,Sys Admin Best Practices...
# 7

If you change the cylinder start to 0, the slice will begin in the same location as slice 0 (which also starts at cyl 0). If slice 0 is in use, this almost certainly is not what you want.

You want to start the slice in used space (perhaps at the same point that slice 5 starts if you are not using it).

If you no longer want to use slice 6, just set the length to 0. The start cylinder doesn't matter.

--

Darren

Darren_Dunham at 2007-7-7 2:54:48 > top of Java-index,General,Sys Admin Best Practices...
# 8
That fsck failure simply means it doesnt have a legal filesystem on it.Which is not surprising if it has just been created.So you just need to do a newfs.
robertcohen at 2007-7-7 2:54:48 > top of Java-index,General,Sys Admin Best Practices...