-1

I would like to know the Unix Command for :

  1. To see the Unix Box partitions.
  2. how to start/stop Unix partition.
2

3 Answers 3

4

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.

2
  • It should be added, that the fdisk-command can be used to show partition (and to change them).
    – Mnementh
    Aug 11, 2009 at 13:47
  • 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, 2009 at 14:06
2

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.

2
  • '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, 2009 at 13:46
  • Thanks, I've edited that line. It's been a little while since I've used fstab...
    – Mark Pim
    Aug 11, 2009 at 13:49
0

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.

You must log in to answer this question.