Help - Search - Members - Calendar
Full Version: Changing Drives
Linuxhelp > Support > Technical Support
ok ......i am in the console and i want to be able to change to drive /hdd1
when i type
# /dev/hdd1

it says permission denied

i am still working on getting a new drive i installed to mount and share :S blink.gif unsure.gif
Not how linux works buddy. Sorry, I don't live in Dayton so let me try to help you.

Linux uses a single structure drive system. Everything starts at / and goes down. You can't "change drives." To get to the data thats on hda1 you have to mount it into a folder in the structure. This is usally done in the mnt folder.

Depending on what distro you are using, this may actually already be done. Do this...
# cd /mnt
# ls

I don't know what you are trying to get at since hdd is usally the cd-rom drive on most systems and thus there wouldn't be a 1 at the end. But if its a hard drive, there will probably be a folder called hdd1 you can cd into it and see if your stuff is there. If its not, come back and tell me whats on hdd1 and what format its in and I will tell you how to mount it.
Ok thanks SO much....ok heres what i am trying to do .....i have a linux fedora file server....i added a 12gb hard drive that i want to share in samba with a directory /Samba
what i was able to do was install the drive to the system fdisk the drive make the filesystem.
no the prob that i am haveing is mounting and then shareing. here are the inscruction someone gave me...any help would be great.... btw the drive id is /hdd it is on the sec ide slave channel.... do i need to move it??
You can add the drive to the computer...

If it is Primary slave, it will be hdb ... If secondary master, it will be hdc ... if it is secondary slave, it will be hdd.

With the new drive installed, boot linux.

Issue the command:

fdisk /dev/hdb <--(or hdc, hdd as appropriate ... make sure NOT to do /dev/hda {your current linux drive})

you will now be at the fdisk prompt ... commands are followed by pressing the enter key (just like at the command prompt).

You can see a list of all commands by pressing m

OK, fisrt thing to do is remove any old partitions (I assume you want to erase this drive and use all the space ... if not, we'll do something else).

Use the command p to print the current partition table.

Now use the command d to remove all partitions (one at a time).

when d no longer works (all partitions are deleted), use the command n to create a new partition...pick primary partiton and if it asks, pick number 1, then accept the defaults for starting and stopping sectors (1 to the end of the drive).

now print the partition table using p ... it should have 1 type 83 (Linux) partition and nothing else. If that is what you want, press w to write these changes (if something isn't right, you can use q to exit without writing changes ... so until you specify w for write, no changes have been made).

Now do fdisk -l ... {that is a lower case l}. You should see 2 drives (once with three partitions ... your boot drive ... once with 1 partition, the new drive).

OK ... we are ready to make a file system on the new drive ... I recommend ext3 for FedoraCore1:

the command to make a new ext3 file system is:

mke2fs -j /dev/hdb1 <--(use hdc1 or hdd1 ... whichever new partition you created)

then change the checks so there are no mounting scans:

tune2fs -c0 -i0 /dev/hdb1
(those are zero's and not O's after -c and -i)

Now you can mount the new drive ... I always mount drives in mount. First, you need to make a directory to mount it in ... I'll call it hdb (if it is /dev/hdc or hdd, you can substitute hdc or hdd)

so ...

mkdir /mnt/hdb

now we want to mount the new drive:

mount -t ext3 /dev/hdb /mnt/hdb

now the command:

df -h

should show a new drive at /mnt/hdb
To make the drive mount at boot time automatically, do this:

edit /etc/fstab and add this line (I would put it under the other mounts like / and /boot, but above any /proc or usb mounts....)

/dev/hdb1 /mnt/hdb ext3 defaults,user 1 1

(you would substitute hdc or hdd as applicable)

reboot and see if it mounts...

do df -h after logging in...

If it is mounted, you can setup a share and point it to /mnt/hdb ...

when you want to put stuff in there, you put it in /mnt/hdb
If you followed those intructions (especially the part about editing the fstab, that the drive is in mnt/hdb and you can access the files there. If you want to mount them into a directory called /samba than you need to make a directory called samba in the file tree. Issue the command mkdir /samba than change the line in your fstab file from
/dev/hdb1 /mnt/hdb ext3 defaults,user 1 1

/dev/hdb1 /samba ext3 defaults,user 1 1

That will automatically mount the drive into the samba folder. From there you will have to set up your samba server to share the folder. If that doesn't work, than there is a problem with the RAID (I assume the drive is on a RAID system since thats the only way to have more than two harddrives).

If there is a problem you will need to tell us weather its onboard on PCI RAID.
ok to make the dirctory from console

mkdir /dev/hdd /samba

like that?
its not on a raid controller its on the sec ide slave
No, you need to make the samba folder on the drive you have linux installed on. Your than going to mound the hdd into the samba folder on the drive your system is.

Thats how you access the files on any other drive but your install.

Type in the command mount at the command line and that will list everything that is mounted in. If you see hdb in the list it will tell you where its mounted. If you don't understand the list post it and I will explain it to you.
ok i think it just that i really understand the way the filesystems work ...but i am learning everyday
The way linux files systems is very different from the way windows does. Windows has a separate drive tree for each physical drive. A for floppy, C for the center drive D for CD and so on. Linux keeps everything under the /. That’s the top of the tree. Everything goes down from there.

Everything on the same partition as the install will show up naturally. Everything else has to be “mounted” into the file tree. That is you have to create a folder that “points” to that drive. Than when you change to that direction you are essentially changing to the disk or partition. So by creating the folder samba on your installation drive and than mounting hdd into that folder, everything on hdd will show up in samba.

What you are doing by adding that line to the fstab file, you are mounting hdd into /samba automatically. Starting to get it?
yea i think so ....getting clearer
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.