Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modifying partitions on Solaris 10 (x86)

Status
Not open for further replies.

neuralnode

Technical User
Sep 12, 2007
59
PL
Hi all,

I'm new to Solaris, and I'd appreciate some advice on the following issue. I'm trying to change the default partition layout by shrinking the oversized /export/home and allocating thusly freed space to 2 or 3 newly created partitions. Unfortunately, the partitions can't be modified while they're mounted. Unmounting /export/home doesn't help either - the format messages are:


partition> label
Cannot label disk when partitions are in use as described.
partition> modify
Cannot modify disk partitions while it has mounted partitions.

The system (Solaris 10) is installed on a x86 PC, so there is no possibillity to enter any lower mode, like OpenBoot Prom.

My question, then, is: How can I accomplish what I want (=shrink /export/home and create new partitions)?

Thanks in advance.

 
If possible, redo the install and specify the sizes you want.

I want to be good, is that not enough?
 
do you have more than one disk, are you mirroring all your file systems using Solaris Volume Mananger (SVM)?


If so than it can be done. if not, KenCunningham has the right idea.
 
No you don't have to do the reinstall.

Boot from CDROM in single, and modify the partition table. In any case, you will have to save a backup image (either on an unchanged filesystem or tape). I believe if you were running SVM you can grow but not shrink the fileystem.

I don't run too much X86, but you should also be able to boot single on the running system(without cdrom) making sure that filesystem is unmounted and change the partition table also.

eugene
 
For someone new, a reinstall would be easier in my opinion.

I want to be good, is that not enough?
 
Yes, but to expect a new user to figure out all the changes between a running system and a fresh one? Hard for experienced admins.
eugene
 
Sorry - I made the assumption and can see that it was possibly wrong!

I want to be good, is that not enough?
 
Hey, not an error. NeuralNode can always do the reinstall if the repartition blows up. I just believe one should always save what you have before throwing it away.

Also newbies might not understand that Solaris is not forgiving in preserving old data if you are not careful.

eugene
 
Hey guys,

Thanks a lot for all your feedback. Actually, before I even had the time to read any of your posts I got some advice from a friend that my goal could be accomplished via single-user reboot. Indeed, it really worked, i.e. from the Grub bootloader menu I chose "safe mode" and when the system went up, I could make all desired changes via the format command, as all vital partitions were unmounted. Specifically, I shrank /dev/dsk/c0d0s7 and used the unallocated space to create 4 new partitions, /dev/dsk/c0d0s3-6. When I rebooted the system to multiuser/standard mode I created new filesystems via the "newfs" command and mounted the new partitions on target mountpoints of my choice. To ensure that those changes are still valid after next reboot, I updated the /etc/vfstab file accordingly.

Probably for you guys it's quite obvious, but I just wanted to share my solution. Still, as the system was fresh while doing said changes, I can't say if this would be a good method on a system that has applications already installed, i.e. would that impact them in any way. I mean let's suppose there's an important application running on /export/home, but I decide the partition is too large, and I shrink it as decribed above. Would the application be still intact? What if its data had been scattered all over the partition, and after I shrunk it, some data was lost? I'd be glad to hear your opinion on this.

Apart from that, though, the method is sufficient, it worked, and I'm fine with the new partition table. I see some of you suggested exactly what I did. Thanks everyone for the input.

rgds.


----------------------------------------
. stay tuned to alien transmissions .


 
Before you shrank it, you would save the filesystem in a place that is untouched (partition/disk not affected or network storage), after the newfs, restore it. And an ufsdump image, not tar, dd. Ufsdump has the best filesystem veracity.

I believe if you didn't newfs'ed it and just shrank the partition, any inode or block pointers outside
the partion would look like corruption and the cylinder groups would be wrong. You might be able to fsck and save it, but why take that chance?

well good luck.
eugene

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top