Mounting Volume
Mounting Volume
So I just stuck a 40gb drive in as slave and I can't mount it... How do I mount it so I cn get into it?? Do I have to reformat it?
What do you mean by you have NTFS support installed? Do you mean the drive is formatted as NTFS or you have the NTFS kernel modules installed to support NTFS or both? If the drive is formatted NTFS you are not going to have much luck using it under Linux except for read only access. If you want to be able to use it for both Linux and Windows you'll want to format it as FAT32 (or vfat if you format it in Linux which is the same as FAT32). If you just want to access it under Linux you'll want to format it as ext3 although there are several other formats you can use. In order to use an existing file system you have to "mount" it onto an empty directory which is referred to as a "mount point". With the drive installed open a terminal, type these commands and paste the output into a message:
I'll be able to help a lot more with the above information.
Code: Select all
$ su -
(enter root's password)
# df -h
# fdisk -l
# cat /etc/fstab
# cat /proc/filesystems
# cat /proc/partitions
# ls -l /proc/ide
Code: Select all
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
12G 3.6G 7.5G 33% /
/dev/hde1 99M 14M 81M 15% /boot
tmpfs 157M 0 157M 0% /dev/shm
Code: Select all
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
Code: Select all
[root@localhost moto526]# cat /proc/filesystems
nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev binfmt_misc
nodev debugfs
nodev securityfs
nodev sockfs
nodev usbfs
nodev pipefs
nodev futexfs
nodev tmpfs
nodev inotifyfs
nodev eventpollfs
nodev devpts
ext2
nodev ramfs
nodev hugetlbfs
iso9660
nodev mqueue
nodev selinuxfs
ext3
nodev rpc_pipefs
nodev autofs
Code: Select all
[root@localhost moto526]# cat /proc/partitions
major minor #blocks name
33 0 13385836 hde
33 1 104391 hde1
33 2 13277722 hde2
33 64 39082680 hdf
253 0 12582912 dm-0
253 1 655360 dm-1
Code: Select all
[root@localhost moto526]# ls -l /proc/ide
total 3
-r--r--r-- 1 root root 0 Jun 23 22:04 drivers
lrwxrwxrwx 1 root root 8 Jun 23 22:04 hdc -> ide1/hdc
lrwxrwxrwx 1 root root 8 Jun 23 22:04 hde -> ide2/hde
lrwxrwxrwx 1 root root 8 Jun 23 22:04 hdf -> ide2/hdf
dr-xr-xr-x 3 root root 0 Jun 23 22:04 ide1
dr-xr-xr-x 4 root root 0 Jun 23 22:04 ide2
First thing's first. Is the system we're working with here your Fedora system or your SUSE system? This thread is in the Fedora section so I assume it's your Fedora system and it looks like a Fedora setup.
I see you missed one command "fdisk -l". I looks like you have 3 drives installed. One drive on ide1 (hdc) and 2 drives on ide2 (hde, hdf). Your current / and /boot file systems are on hde. Looks like you put your new drive in on the same cable as your other hard drive. The CD/DVD appears to be on it's own cable. Is this correct? If so your new drive is "hdf" and your cd is "hdc". You can verify by looking in the output of your "dmesg" command (among other ways):
I'll continue with the assumption that your new drive is hdf and your CD/DVD is hdc. Your current / file system is an ext3 file system residing on a logical volume made of of a physical volume which is a partition on your first hard drive. The partition is probably /dev/hde2 although I can't tell for sure without running a couple of "lvm" commands (vgdisplay,lvdisplay,pvdisplay).
There are a couple of ways to add the space on this disk to your system:
1) You can create another physical volume on this new drive and add this new PV to the volume group that your / file system resides on and then resize your / file system to use the new found space so when you do a "df -h" / would show up with 40GB more in the "Size" and "Avail" columns than it does now. In the Windows world this would be like increasing the size of your C: drive.
2) You can just put a new file system on the new drive and mount it under another mount point. In the Windows world this would be like having another drive letter (a 40GB D: drive).
Actually you have a lot more options than just the above 2 depending on how you want to use this drive and whether you might have other plans for it in the near future. You could also set up RAID and mirror your / file system or have many other combination of possibilities, but we won't get into that just yet.
I would suggest for now we just set it up as a new file system and mount it under a new mount point. Here's how I would go about doing that (what you type is in red):
First, create a partition (/dev/hdf1) on that new drive (/dev/hdf) using fdisk:
To make it automatically mount at boot time add this line to your /etc/fstab file:
Just be very careful not to change any other line in that file when editing it. It wouldn't be a bad idea to first make a backup copy of it.
Use "chmod" to change permissions "chown" to change ownership on the mount point and "mkdir" to create directories, etc.
That's basically it. Now, there are pros and cons to adding your new disk this way and there are pros and cons in adding it to your existing volume group and increasing the size of your logical volume. I won't go into all of these now because I have to get the trailer hooked up and head out riding! :) Do some google searching on all these terms and play around.
I see you missed one command "fdisk -l". I looks like you have 3 drives installed. One drive on ide1 (hdc) and 2 drives on ide2 (hde, hdf). Your current / and /boot file systems are on hde. Looks like you put your new drive in on the same cable as your other hard drive. The CD/DVD appears to be on it's own cable. Is this correct? If so your new drive is "hdf" and your cd is "hdc". You can verify by looking in the output of your "dmesg" command (among other ways):
Code: Select all
$ dmesg | grep hdc
$ dmesg | grep hdf
There are a couple of ways to add the space on this disk to your system:
1) You can create another physical volume on this new drive and add this new PV to the volume group that your / file system resides on and then resize your / file system to use the new found space so when you do a "df -h" / would show up with 40GB more in the "Size" and "Avail" columns than it does now. In the Windows world this would be like increasing the size of your C: drive.
2) You can just put a new file system on the new drive and mount it under another mount point. In the Windows world this would be like having another drive letter (a 40GB D: drive).
Actually you have a lot more options than just the above 2 depending on how you want to use this drive and whether you might have other plans for it in the near future. You could also set up RAID and mirror your / file system or have many other combination of possibilities, but we won't get into that just yet.
I would suggest for now we just set it up as a new file system and mount it under a new mount point. Here's how I would go about doing that (what you type is in red):
First, create a partition (/dev/hdf1) on that new drive (/dev/hdf) using fdisk:
If that went well you can now create a file system on that new partition. Let's create an ext3 file system:$ su -
(enter root's password)
# fdisk /dev/hdf
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-xxxx, default 1): (Just Press ENTER)
Last cylinder or +size or +sizeM or +sizeK (1-xxxx, default xxxx): (Just Press ENTER)
p (this command shows your new partition table)
w (this command writes the partition table to disk)
Now you'll want to mount this file system somewhere so you can use the space. First create a mount point (this can be any empty directory anywhere you want). Let's just create a directory called "/data" and mount it there so you can use it as a storage area:# mkfs.ext3 /dev/hdf1
Now check to see if it shows up in your "df" output:# mkdir /data
# mount /dev/hdf1 /data
Now there are some other things to consider. This new drive will not automatically mount when you reboot your machine so you'll want to add it to your /etc/fstab (file system table) so it does automatically mount. You will also want to set permissions however you want depending on who you want to access this new area and what sort of permissions they should have.# df -h
To make it automatically mount at boot time add this line to your /etc/fstab file:
Code: Select all
/dev/hdf1 /data ext3 defaults 1 2
Use "chmod" to change permissions "chown" to change ownership on the mount point and "mkdir" to create directories, etc.
That's basically it. Now, there are pros and cons to adding your new disk this way and there are pros and cons in adding it to your existing volume group and increasing the size of your logical volume. I won't go into all of these now because I have to get the trailer hooked up and head out riding! :) Do some google searching on all these terms and play around.
No, you do have an extra drive. It's mounted on a directory. You don't have any of those stupid drive letters (C:, D:, etc) if that is what you mean. Like I said, the space on that new drive could have been incorporated right into your "/" (root) file system instead of having that 40GB under the "/data" directory. A "df -h" would have shown the same things it did before adding the drive except the size of "/" would have increased from 12GB to 52GB and you would have had 47.5GB available (free) rather than 7.5GB. But yes, you can think of "/data" as a new drive letter in DOS or Windows. In Linux and UNIX there is only one directory structure that can be made up of several partitions (and they don't even have to have the same format) where in DOS/Windows you have more than one drive letter each with it's own directory structure. I think the more you use Linux the more you'll prefer the one directory structure with no drive letters. In fact you'll eventually probably think to yourself "drive letters are stupid, who came up with that stupid idea". :)moto526 wrote:Thanks! Got it....
I am used to having an extra drive and now it is a folder, I am not quite sure why we went that way but I am not going to complain, must be a linux thing.