LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 11-18-2007, 08:13 AM   #1
driftboy
Member
 
Registered: Dec 2006
Location: USA
Distribution: Debian etch 4.0 net installed
Posts: 79

Rep: Reputation: 16
can some tell me how to mount 2nd HD


Hi,

I am using debian etch and I need to know how to mount a 2nd hard drive for extra space. Would like it to auto mount with any login users to us it.

ty
 
Old 11-18-2007, 09:52 AM   #2
Th3_J3st3R
Member
 
Registered: Mar 2003
Location: Milwaukee
Distribution: Slackware 12.0
Posts: 84

Rep: Reputation: 16
Please, use the SEARCH, or use your MAN pages. Your not going to get anywhere unless you put in the time to read.

man mount

http://www.linuxquestions.org/questi...-drive-359074/
 
Old 11-18-2007, 10:50 AM   #3
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Also consult man fstab for information about mounting during a boot
and look at man mkfs for information about formatting a drive

Sometime an info <subject> presents more details and an easier-to-read alternative to the man command.

Oh, another useful tool is parted for creating and changing disk partitions.

Another thing: If you're moving to *nix from Windows, you should note that *nix system do not force you to create a separate "top-level" entry for different drives. You can attach a file system residing in any hard drive at any point in your file system you want to use. Basically, a *nix system has a single "logical" file system, organized hierarchically below the top level ("/"), almost independent of any physical devices where data is stored.

For illustration purposes only, here's what my Fedora 8 etc/fstab looks like:
Code:
$ cat /etc/fstab
/dev/F8/Base            /                       ext3            defaults          1 1
LABEL=/boot1            /boot                   ext3            defaults          1 2
tmpfs                   /dev/shm                tmpfs           defaults          0 0
devpts                  /dev/pts                devpts          gid=5,mode=620    0 0
sysfs                   /sys                    sysfs           defaults          0 0
proc                    /proc                   proc            defaults          0 0
#/dev/sda3              swap                    swap            defaults          0 0
#/dev/FC7/Swap          swap                    swap            defaults          0 0
/dev/F8/Swap            swap                    swap            defaults          0 0

#Added by hand
# /dev/sda2
UUID=9b52dc27-f2c9-4238-afaa-c8e4691ea777 \
                        /Ubuntu/                ext3            defaults,errors=remount-ro         0 1
# /dev/sda1
UUID=e8e90e29-1025-433d-aaab-fdab05150ddf \
                        /Ubuntu/boot3           ext3            defaults          0 2
# /dev/sdb1
UUID=72ECD97FECD93E53   /XP                     ntfs-3g         defaults,umask=007,gid=10  0 1
/dev/hde                /media/cdrom0           udf,iso9660     user,noauto,exec  0 0
/dev/fd0                /media/floppy0          auto            rw,user,noauto,exec                0 0
/dev/FC7/Base           /Ubuntu/F7              ext3            defaults          0 0
LABEL=/boot             /Ubuntu/F7/boot         ext3            defaults          0 0
/dev/USB_Fedora/Base    /usb                    ext3            defaults,noauto   0 0
LABEL=/usb_boot         /usb/boot               ext3            defaults,noauto   0 0
/dev/sde1               /usb/shared             ext3            defaults,noauto   0 0
 
Old 11-18-2007, 11:15 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
You probably know this. Before mounting the drive, you need to format it and create a filesystem on the partition.

If any user can use this partition, then it may be best to use the same permissions that the /tmp directory uses. You need to mount the partition before using chmod. "sudo chmod a=rwxt path/to/mountpoint".

Some distro's such as Mandriva & SuSE have a partitioner that can make the process easier. You can use them to create the filesystem (format) and to add an entry to /etc/fstab. Otherwise, you use "sudo /sbin/fdisk /dev/hdb" or "sudo /sbin/fdisk /dev/sdb" to format the partition. You next need to create the filesystem. Here you need to decide which filesystem to use. I am happy with ext3. I have used reiserfs and xfs in the past. Here is what my laptop's /etc/fstab entry looks like for the root partition:
Code:
/dev/disk/by-id/scsi-SATA_FUJITSU_MHU2100_NQ07T4825B7P-part6 / ext3   acl,user_xattr        1 1
You could use the form "/dev/hda1" instead. If you use /dev/disk/by-id/ or /dev/disk/by-uuid/, then make sure you use the value for your partition and not the value that I gave. Simple use "ls /dev/disk/by-id/" to look up your value.

Fedora core uses lvm. You can use the "/usr/sbin/system-config-lvm" program to add your new disk to the lvm volume. This would allow you to increase the size of /home, by adding your new drive to its lvm volume. Otherwise you need to create a mount point for your new partition.

Please put your distro in your LQ profile. That would enable us to give better answers.

Last edited by jschiwal; 11-18-2007 at 11:16 AM.
 
Old 11-19-2007, 12:37 AM   #5
driftboy
Member
 
Registered: Dec 2006
Location: USA
Distribution: Debian etch 4.0 net installed
Posts: 79

Original Poster
Rep: Reputation: 16
I dont understand, please just post the codes.

I want to auto mount /dev/hdb1 /media/storage so that all users on this computer can read and write to it.

ty

file system ext3

Last edited by driftboy; 11-19-2007 at 12:42 AM.
 
Old 11-19-2007, 01:01 AM   #6
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
To reiterate: read the man page for mount. It's really not hard.
 
Old 11-19-2007, 02:17 AM   #7
driftboy
Member
 
Registered: Dec 2006
Location: USA
Distribution: Debian etch 4.0 net installed
Posts: 79

Original Poster
Rep: Reputation: 16
why not just say

add to /etc/fstab
/dev/hdb1 /media/storage ext3 rw,user 0 0
 
Old 11-19-2007, 01:36 PM   #8
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Originally Posted by driftboy View Post
why not just say

add to /etc/fstab
/dev/hdb1 /media/storage ext3 rw,user 0 0
Well, because there are lots of options you can use, and it wasn't clear what you actually wanted.

For example, the "0 0" at the end of your proposed line disables fsck boot-time checking of the file system, and would only normally be done for file systems that a not mounted during the boot process. (In my example, above, that's what the "noauto" option is for -- to tell udev that the file system is on removable media, and that it might not be available when the system is booted.)

Also, by specifying "rw,user" you have granted r/w access to whoever mounts the file system, and permitted any user to do so. Since the file system will (implicitly) be mounted during the boot process, it will be owned by "root" and be in the "root" group. Thus the system administrator will need to set access and ownership values for any files in /media/storage before anyone else will be able to use the device. (Note that a "directory" is, on *nix systems, just another type of file.) While this may be what you want, again it was neither clear nor usual that you would want to do so. More commonly one just uses the "defaults" option on boot-mounted file systems, and then sets the permissions on /media/storage like this: chmod u+rwxt,g+rwx,o+rwx /media/storage so that everyone can read or execute any file in the "storage" directory, but only the user that created the file (or "root") can delete the file. (These are the permissions that are set on the /tmp directory.)

All the above is why we were recommending that you read the manual pages for the commands you intend to use. We can't read your mind to know what you want, and, as you specified in your example, when what you want is not "standard" you either need to provide more details or, as we suggested, read the information provided in your distribution and see how you want to do it.

The power and problem with systems like Linux is that you can do almost anything you want to do with the system (power), but you have to know how to do it (problem). And the documentation can be overwhelming since it needs to cover all the possibilities, not just the "common" ones.

Last edited by PTrenholme; 11-19-2007 at 01:40 PM.
 
Old 11-19-2007, 05:33 PM   #9
driftboy
Member
 
Registered: Dec 2006
Location: USA
Distribution: Debian etch 4.0 net installed
Posts: 79

Original Poster
Rep: Reputation: 16
Thank you PTernholme, That is what I needed to know. I am gonna keep studying your advice and hope to understand linux better.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Set up rsync to mirror mount on Windows Server to mount point on 2nd internal drive MoMule Linux - Server 4 04-13-2007 09:34 PM
locate and mount 2nd harddrive wetnose23 Slackware 6 01-06-2006 06:37 PM
How do I mount a 2nd CD drive??? phreakshew Linux - Newbie 22 09-05-2005 07:51 PM
How do i mount a partition on a 2nd HD? Linux_Nooby Linux - Newbie 5 03-22-2005 05:41 PM
Where to mount 2nd and 3rd disks vrillusions Linux - Hardware 3 11-29-2003 05:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration