Determine free space in a Disk device


 
Thread Tools Search this Thread
Operating Systems Solaris Determine free space in a Disk device
# 1  
Old 11-07-2011
Determine free space in a Disk device

Version: Solaris 10 (August 2011) on VM

I am kind of new to Solaris.From VM workstation i allocated 35 GB to this Solaris VM's Disk

The disk was named

c1t0d0

Few basic slices for root(8gb), swap(517mb) and /export/home(494mb) were created by the solaris Installer during the installation.

/dev/dsk/c1t0d0s0 is currently mounted on /. Please see umount(1M).
/dev/dsk/c1t0d0s1 is currently used by swap. Please see swap(1M).
/dev/dsk/c1t0d0s7 is currently mounted on /export/home. Please see umount(1M).


Now there is around 25 gb left unallocated in the underlying disk. Using format command, I wanted to create a new slice with 20gb, but i was getting

`20.00gb' is out of range

error. I tried 10g but it didn't work. 1GB worked though.

Is there any way i could determine how much space is left in the Disk after these slice creations ? I see lot of options in format command , but i couldn't find a command to determine how much space remain unallocated in a Disk device c1t0d0 .



Here is what i tried to do to create a new slice of 20 gb. In case you find anything wrong , please let me know



Code:
# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c1t0d0 <DEFAULT cyl 1273 alt 2 hd 255 sec 63>
          /pci@0,0/pci15ad,1976@10/sd@0,0
Specify disk (enter its number): 0
selecting c1t0d0
[disk formatted]
Warning: Current Disk has mounted partitions.
/dev/dsk/c1t0d0s0 is currently mounted on /. Please see umount(1M).
/dev/dsk/c1t0d0s1 is currently used by swap. Please see swap(1M).
/dev/dsk/c1t0d0s7 is currently mounted on /export/home. Please see umount(1M).


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit
format> p


PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        !<cmd> - execute <cmd>, then return
        quit
partition> p
Current partition table (original):
Total disk cylinders available: 1273 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm     130 - 1272        8.76GB    (1143/0/0) 18362295
  1       swap    wu       1 -   66      517.72MB    (66/0/0)    1060290
  2     backup    wm       0 - 1272        9.75GB    (1273/0/0) 20450745
  3 unassigned    wm       0               0         (0/0/0)           0
  4 unassigned    wm       0               0         (0/0/0)           0
  5 unassigned    wm       0               0         (0/0/0)           0
  6 unassigned    wm       0               0         (0/0/0)           0
  7       home    wm      67 -  129      494.19MB    (63/0/0)    1012095
  8       boot    wu       0 -    0        7.84MB    (1/0/0)       16065
  9 unassigned    wm       0               0         (0/0/0)           0

partition> 3
Part      Tag    Flag     Cylinders        Size            Blocks
  3 unassigned    wm       0               0         (0/0/0)           0

Enter partition id tag[unassigned]: reserved
Enter partition permission flags[wm]:
Enter new starting cyl[1]: 130
Enter partition size[0b, 0c, 130e, 0.00mb, 0.00gb]: 20.00gb
`20.00gb' is out of range
Enter partition size[0b, 0c, 130e, 0.00mb, 0.00gb]: 10.00gb
`10.00gb' is out of range
Enter partition size[0b, 0c, 130e, 0.00mb, 0.00gb]: 1.00gb


# 2  
Old 11-07-2011
Nothing left all partitions are assigned you need to reparation your disk
This User Gave Thanks to h@foorsa.biz For This Post:
# 3  
Old 11-07-2011
But I had allocated 35gb to this VM.
Going back to my original question : How to determine how much space is left in the Disk from format or any other command? Is it from the partition table that u realized that there is no space left ?
Thank you Foorza.
# 4  
Old 11-07-2011
The disk you have is not 35GB, but 9.75GB (at least it was initially labeled as such).
# 5  
Old 11-07-2011
Quote:
Originally Posted by polavan
But I had allocated 35gb to this VM.
Going back to my original question : How to determine how much space is left in the Disk from format or any other command? Is it from the partition table that u realized that there is no space left ?
Thank you Foorza.
How did I know ? Well I assumed that you have performed a default install for Solaris.
To get information about the disk
Code:
$iostat -En

If the disk is a supported disk, it usually says it's size in the "Product" field.
# 6  
Old 11-08-2011
Thank you Bartus11,Foorsa

From my underlying disk c1t0d0

I need to create the following filesystems.

9GB for /
2GB for swap
1.5GB for /tmp
1GB for /export/home
20GB for /u02

Can this be done during the installation itself? If so, In the following link , at "Screen 29"

ORACLE - DBA Tips Corner

What should i choose ?

Should i allocate the entire disk space to 'Solaris' partion On "Customize fdisk partitions' screen at first ?
# 7  
Old 11-08-2011
you should simply enter every slice and its size. they have provided example for / and swap.

order of slices might be important. because (spinning) disk is faster at beginning. (but not much if its inside virtual machine)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I need help!! disk free space script

i want to write a shell script,when disk uses is 90% then automatically send a email to distribution list (group member)...... (1 Reply)
Discussion started by: sonu pandey
1 Replies

2. Solaris

No space left on device but free space and inodes are available...

hi guys, me again ;) i recently opened a thread about physical to zone migration. My zone is mounted over a "bigger" LUN (500GB) and step is now to move the old files, from the physical server, to my zone. We are talking about 22mio of files. i used rsync to do that and every time at... (8 Replies)
Discussion started by: beta17
8 Replies

3. Shell Programming and Scripting

Free space at disk

Hi, I would like to create the new file system(mount point) in our unix server. before that i would like to know the total free space available in /home directory. Can you please let me know, how to find free space available for new filesystem? Be careful with your spelling and... (2 Replies)
Discussion started by: koti_rama
2 Replies

4. AIX

Determine disk space in AIX

Hi I need to extend a FS in AIX but Im not sure on how to calculate the free space Please advise if my math is correct: -------PP SIZE: 64 megabyte(s) --------TOTAL PPs: 1086 (69504 megabytes) so the total size of volume is 64 * 1086 = 69504 MB (695GB) Free PP is-- FREE... (4 Replies)
Discussion started by: hedkandi
4 Replies

5. Linux

shrinking root partition and using free space to create a block device

We are intending to protect a set of user specified files using LVM mirroring where the protected space on which the user files are stored is mirrored on an LV on a different disk. Our problem is that for a user with a custom layout has installed linux with 2 partitons for swap and / and there is... (0 Replies)
Discussion started by: kickdgrass
0 Replies

6. AIX

Determine space on a disk

Hello, I am trying to understand how to calculate actual disk space on a logical volume. Based on the output below, how would I convert the total and free PPs to MB and GB? Thank you. # lsvg rootvg VOLUME GROUP: rootvg VG IDENTIFIER: ... (4 Replies)
Discussion started by: dkranes
4 Replies

7. Programming

free disk space calc

I everybody!! How can i use statvfs() to calculate disk usage and free disk space?? Im using this code: /* Any file on the filesystem in question */ char *filename = "/home/nesto/test/test.cpp"; struct statvfs buf; if (!statvfs(filename, &buf)) { ... (1 Reply)
Discussion started by: ninjanesto
1 Replies

8. UNIX for Dummies Questions & Answers

how to determine the disk space usage

how can we determine the disk space used by a certain directory? (1 Reply)
Discussion started by: gfhgfnhhn
1 Replies

9. UNIX for Dummies Questions & Answers

available disk space on disk device???

Hello, Can someone please tell me which command to use to determine the available disk space on a given disk device? I have to write a shell script that compresses files and stores them in a specific location but I am not sure how "conservative" I should be? Thanks in advance! Al. (4 Replies)
Discussion started by: alan
4 Replies

10. UNIX for Dummies Questions & Answers

Device Free Space

Hi, I've tried to find answer to this question in the forums but i haven't found it. How can i know the space left in my devices (tape, disk, floppy, etc...)? It is very important to know at least the free space in the TAPE device. Can someone help? Thanx in advance. Jorge (1 Reply)
Discussion started by: jorge.ferreira
1 Replies
Login or Register to Ask a Question