Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to know the Unix Command for :

  1. To see the Unix Box partitions.
  2. how to start/stop Unix partition.
share|improve this question

migrated from stackoverflow.com Aug 11 '09 at 13:48

This question came from our site for professional and enthusiast programmers.

2  
Do you mean you want to know how to mount a partition? linux.about.com/od/commands/l/blcmdl8_mount.htm –  Mark Pim Aug 11 '09 at 13:37
2  
OR create and delete partitions? linux.about.com/od/commands/l/blcmdl8_fdisk.htm –  Mark Pim Aug 11 '09 at 13:38

3 Answers 3

Making guesses at what you mean, I suggest:

1) To list all mounted drives:

mount

To find out how much space you have on each drive, and for a clearer display of which device corresponds to which directory, type:

df -h

2) To un-mount (remove) a drive:

umount /dev/hda

To mount (add/start) a drive:

mount /dev/hda

(where /dev/hda is the device you'd like to unmount)

To edit your partitions, try:

fstab

To find out more about these commands type:

man mount

or:

man df

or:

man fstab

respectively.

share|improve this answer
    
It should be added, that the fdisk-command can be used to show partition (and to change them). –  Mnementh Aug 11 '09 at 13:47
    
Thanks Mnementh. Added. –  Andy Balaam Aug 11 '09 at 14:01
    
I would add one more item to your post. df -k will show the file system and which mounted partition it maps to. –  Axxmasterr Aug 11 '09 at 14:06
    
Thanks Axxmasterr. Added. –  Andy Balaam Aug 11 '09 at 14:10

It's not entirely clear what you're asking but here's some pointers about partitions in Unix.

  • Type cat /etc/fstab to see how the volumes are set up to be mounted at startup
  • Use fdisk to examine and edit hard disk partitions
  • Use mount to give you access to partitions/volumes from the root filesystem

Post a comment if you want more help on using any of those commands.

share|improve this answer
    
'cat /etc/fstab' does not return the currently mounted volumes (that does the command mount without params), but defines the volumes the system should mount at startup. –  Mnementh Aug 11 '09 at 13:46
    
Thanks, I've edited that line. It's been a little while since I've used fstab... –  Mark Pim Aug 11 '09 at 13:49

Keeping in mind that in UNIX your devices are shown as files in the /dev/ folder, the best way to view all partitions is action ls /dev/.

For example, on FreeBSD:

$ ls -1 /dev/amrd*
/dev/amrd0
/dev/amrd0s1
/dev/amrd0s1a
/dev/amrd0s1b
/dev/amrd0s1c
/dev/amrd0s1d
/dev/amrd0s1e

On Linux the drives tend to be sd* or hd*, while OSX uses disk*.

Once you have your partition that you want to "start":

mount /dev/amrd0s1d /mnt/storage/

And to "stop" the partition:

umount /mnt/storage/

Check the man pages for either for more detailed uses.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.