LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-11-2007, 05:23 PM   #1
lordicon
LQ Newbie
 
Registered: Jul 2007
Posts: 13

Rep: Reputation: 0
mounting


i have fedora 7. I am trying to mount or format or do whatever needs to be done to change the file system of my 2nd 20gig hd that is in there so i can use it as a little extra free space... although, being new to linux i have not managed to find that command that will allow me to do such a thing. any ideas?

-Brandon
 
Old 07-11-2007, 05:36 PM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
OK... back up: what do you have now? What do you want it to be?

I am guessing that you have a 20GiB HDD partitioned and formatted in some way you no longer need? You would like to change this to some partition + formatting you hope will be more useful to you?

Can you see the gaps in that description?

The partition tool most commonly used is called "parted" ... sometimes qparted and sometimes gparted and other things depending on the install. It is very likely that this is the tool you want.
 
Old 07-11-2007, 05:38 PM   #3
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Check on.

Might check on mkfs

I'm not positive fedora uses the same.

Looks like in fedora you would use fdisk to re-partition and format the drive and add the entry to the fstab to make it mount on boot.

Last edited by Hern_28; 07-11-2007 at 05:54 PM.
 
Old 07-11-2007, 05:42 PM   #4
lordicon
LQ Newbie
 
Registered: Jul 2007
Posts: 13

Original Poster
Rep: Reputation: 0
haha.. i see what you meen....

this is what i have:

[root@nani ~]# fdisk -l

Disk /dev/sda: 6448 MB, 6448619520 bytes
240 heads, 63 sectors/track, 833 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 14 105808+ 83 Linux
/dev/sda2 15 833 6191640 8e Linux LVM

Disk /dev/sdb: 20.4 GB, 20490559488 bytes
240 heads, 63 sectors/track, 2646 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 2645 19996168+ 7 HPFS/NTFS


I would like to change /dev/sdb1 from NTFS to whatever a LINUX file system.

For the end result, i would like to be able to use 'sdb1' for more storage and not have to mount it every time i reboot my computer.
 
Old 07-11-2007, 05:49 PM   #5
lordicon
LQ Newbie
 
Registered: Jul 2007
Posts: 13

Original Poster
Rep: Reputation: 0
[root@nani ~]# mkfs /dev/sdb1
mke2fs 1.39 (29-May-2006)
/dev/sdb1 is mounted; will not make a filesystem here!


is what i get with mkfs. but again i am still new
 
Old 07-11-2007, 05:56 PM   #6
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Edit: this post was being written while the one above was being posted. Evidently your second hard drive is /dev/sdb and the partition is /dev/sdb1.

If your computer has only IDE disks then the second IDE disk will be accessed as /dev/hdb. I am not familiar with the Red Hat environment so I will tell you how to do this on any Linux system. It will require that you use the command line utilities.

The following procedure will destroy all data on the disk. If you want to preserve the data on the disk you can skip the parts about creating a partition table and about making a file system on the disk partition.

You first see if Linux can detect the hard drive using fdisk. Then you use cfdisk or fdisk to create a partition table. I recommend using cfdisk because it makes a graphic representation of the disk structure. Then you use mkfs to create a file system. Then you use the mount command to connect the file system on the second disk to a directory somewhere in the Linux file structure.

First log on as root.

Next see if Linux detects your second hard disk.
Code:
fdisk -l

Disk /dev/hda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1        1094     8787523+   7  HPFS/NTFS
/dev/hda2            1095        1155      489982+  82  Linux swap / Solaris
/dev/hda3   *        1156        2249     8787555   83  Linux
Here you can see that Linux only sees one hard disk on my system. If I had a second hard disk then the display would continue listing the partitions of that disk.

Use cfdisk to recreate the partition table on the second IDE disk.
Code:
cfdisk /dev/hdb
Cfdisk is a lot like the partition utility in the Windows installation software. Delete any partition that is there. Then create a partition. Make it a primary partition. Make the type a Linux partition. Write the partition table to disk. Quit.

Next see if Linux detects your changes by running fdisk -l again.

Now make a file system on the second hard disk using the mkfs utility.
Code:
mkfs -t ext3 /dev/hdb1
Now create a mount point. A mount point is a directory. Let's say that you want to mount the partition at /mnt/hdb1.
Code:
mkdir /mnt/hdb1
mount /dev/hdb1 /mnt/hdb1
Note that you only have to create the /mnt/hdb1 directory once. It will not go away unless you delete it.

Now allow your local users to access the disk by changing the ownership and permissions of the mount point with the partition mounted.
Code:
chown root:users /mnt/hdb1
chmod g+rwx /mnt/hdb1
You only have to do this one time as well. The permissions and ownership will remain unless you change them.

Now add a line in the file /etc/fstab to tell Linux to mount the partition every time the operating system starts.
Code:
cd /etc
cp fstab fstab.original
Now use any editor you like to edit the file /etc/fstab. Add this line to the end of that file.
Code:
/dev/hdb1  /mnt/hdb1  auto default 0 0
That should do it.

When I was adding tags to this discussion I found that there is already a mount+howto tag. You might want to search for that tag in the search feature on this web site.

Last edited by stress_junkie; 07-11-2007 at 06:18 PM.
 
Old 07-11-2007, 06:00 PM   #7
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 57
you can't have a harddrive mounted when you make a parition
 
Old 07-11-2007, 06:03 PM   #8
lordicon
LQ Newbie
 
Registered: Jul 2007
Posts: 13

Original Poster
Rep: Reputation: 0
-bash: cfdisk: command not found
 
Old 07-11-2007, 06:03 PM   #9
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Quote:
Originally Posted by AceofSpades19
you can't have a harddrive mounted when you make a parition
I can't keep up with all the comments. I originally didn't know which post you were commenting on. Then I found out. Ooops. Sorry. Disregard this post.

Last edited by stress_junkie; 07-11-2007 at 06:15 PM.
 
Old 07-11-2007, 06:05 PM   #10
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Quote:
Originally Posted by lordicon
-bash: cfdisk: command not found
I have to believe that cfdisk is available in the Red Hat repository. I was hoping that it was installed by default, as it is in some other distros. I haven't spent any serious amount of time with Red Hat for about ten years.

Cfdisk is a bit friendlier than fdisk.

Last edited by stress_junkie; 07-11-2007 at 06:06 PM.
 
Old 07-11-2007, 06:06 PM   #11
lordicon
LQ Newbie
 
Registered: Jul 2007
Posts: 13

Original Poster
Rep: Reputation: 0
lol... so then... my next question will be... how do i unmount a harddrive so i can begin this little venture of mine?
 
Old 07-11-2007, 06:06 PM   #12
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
Quote:
Originally Posted by lordicon
[root@nani ~]# mkfs /dev/sdb1
mke2fs 1.39 (29-May-2006)
/dev/sdb1 is mounted; will not make a filesystem here!


is what i get with mkfs. but again i am still new
# umount /dev/sdb1
# fdisk /dev/sdb1

... follow instructions.
 
Old 07-11-2007, 06:09 PM   #13
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Quote:
Originally Posted by lordicon
lol... so then... my next question will be... how do i unmount a harddrive so i can begin this little venture of mine?
See if you have fdisk.
Code:
which fdisk
The only difference between cfdisk and fdisk is that the fdisk display is less informative. You still go through the same steps. When you start fdisk it will tell you the command for getting help. Then you just enter each step at the command line in the sequence that I listed above.

The Linux type of partition is number 83 in fdisk.

Last edited by stress_junkie; 07-11-2007 at 06:11 PM.
 
Old 07-11-2007, 06:09 PM   #14
lordicon
LQ Newbie
 
Registered: Jul 2007
Posts: 13

Original Poster
Rep: Reputation: 0
following instructions...

[root@nani ~]# fdisk /dev/sdb1

The number of cylinders for this disk is set to 2489.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
 
Old 07-11-2007, 06:13 PM   #15
lordicon
LQ Newbie
 
Registered: Jul 2007
Posts: 13

Original Poster
Rep: Reputation: 0
for everything in fdisk that i attempt to do i'm asked for a partition number 1-4 i am not quite sure how to find which partition number i am supposed to use

Command (m for help): t ext3
Partition number (1-4):

i am aware of the fact that i am not typing things in right at all times... i am afraid though of messing something up
 
  


Reply

Tags
mount


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
mounting a mount (recursive mounting?) fudam Linux - General 6 10-16-2006 05:50 PM
mounting digital camera, mounting in general? lugoteehalt Linux - Hardware 6 08-29-2006 12:52 PM
Gnome 2.6 Right click mounting and the mounting system Acetylcholine Linux - Hardware 0 07-25-2004 07:34 AM
Mounting HDD vs. Mounting Filesystem snailophone Linux - Hardware 4 08-12-2003 11:00 AM
Mounting mounting extended partition and its Logical drives desbyleo Linux - Newbie 10 02-18-2002 03:13 PM


All times are GMT -5. The time now is 05:42 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration