Tuesday Dec 19, 2006

HOWTO: Creating & Mounting a Solaris partition on a USB disk drive

For a change, this entry will not be about web services or identity management. It's all about using Solaris commands to create a Solaris partition on a USB removable disk drive. Since I didn't find anything that looked like a short HOWTO for this I thought I'd create a post on that so here we go:

  1. /etc/init.d/volmgt stop
    This turns off vold - not always friendly with usb mass storage devices)
  2. svcs volfs
    It should show volfs as disabled (after step 1).
  3. rmformat -l
    To list the removable devices; this allows to figure out where is my usb disk! (/dev/rdsk/c4t0d0p0 in this example).
  4. fdisk /dev/rdsk/c4t0d0p0
    To create the main Solaris partition. If no partition were initially present, just answering yes to the subsequent question will assign 100% of the disk to Solaris.
    side note: some of you may remember that Linux & Solaris did not like to be on the same disk since Solaris uses the same file format type number than Linux...Well the good news is that one can (and should) use the Solaris2 type so as to avoid those conflicts.
  5. /rmformat -s /tmp/my_slices /dev/rdsk/c4t0d0p0
    Where my_slices is a text file that describes my slices in the partition. Note Solaris has one "main" partition that you divide in slices (8 max). The slice #2 represents the entire filesystem while others are your own partition). An example of such file would be:
    slices:    2 = 0, 350GB, "wm" "backup" :
                   8 = 0, 350GB, "wm", "name"
  6. prtvtoc /dev/rdsk/c4t0d0p0
    To display the toc on the usb disk and make sure the change took effect.
  7. newfs -v /dev/rdsk/c4t0d0s8
    Assuming you've labeled your partition as #8 (like in the example above).
  8. mount /dev/dsk/c4t0d0s8 /mnt
    Note that it is 'dsk' and not 'rdsk' since we're now addressing the disk in block mode and not the raw disk when we wanted to format it.

 

That's it, you now can stuff this partition with plenty big files or use it as a backup media (my case).

 

 

 

About

hubertsblog

Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today