Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Please Help? Accessing hard disk partition in Linux


    This is the output i get when i issue df -h command on Redhat linux.

    [abcd@node2 ~]$ sudo df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda2 3.0G 1.3G 1.5G 47% /
    none 441M 0 441M 0% /dev/shm
    fs.isi.deterlab.net:/mnt/projects/proj/WormTraffic
    989G 142G 768G 16% /proj/WormTraffic
    fs.isi.deterlab.net:/mnt/other/users/xyz
    597G 97G 453G 18% /users/xyz
    fs.isi.deterlab.net:/mnt/other/users/abcd
    597G 97G 453G 18% /users/abcd
    fs.isi.deterlab.net:/mnt/share
    20G 9.6G 8.5G 54% /share
    [abcd@node2 ~]$ pwd
    /users/abcd

    I want to access the /dev/sda2 partition, as seen from above right now i am on /users/abcd

    I can get root access using the sudo command.

    Can anyone just tell me how to store any file on /dev/sda2 and later how to access it. Are we required to use some special commands for this.

  2. #2
    IF i try to copy a file, i get the following error

    [abcd@node2 ~]$ cp Startattacks1 /dev/sda2/Startattacks
    cp: accessing `/dev/sda2/Startattacks': Not a directory

  3. #3
    Linux Guru AlexK's Avatar
    Join Date
    Feb 2005
    Location
    Earth
    Posts
    3,379
    /dev/sda2 is the name of the device, when you use commands such as cp to copy, you have to use the mount point of the device to actually do the copying. In your case, you would want to try:
    Code:
    cp Starattacks /
    what this means is, copy some file called starattacks to the root directory.

    This is from looking at output from df -h, it says /dev/sda2 is mounted as / i.e. the root partition.

    I suggest you read through this tutorial to get a better understanding.
    Life is complex, it has a real part and an imaginary part.

  4. $spacer_open
    $spacer_close
  5. #4
    Hey Alexk,

    Thanks for the help, the tutorial was very useful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •