Submitted by mike8 on Sun, 02/19/2012 - 12:57
I put 2 1.5TB drives in the server, and wanted to just install Linux on the 1st one, and use the second one for a back up. Problem is I go into Hardware it sees both drive, but I can only access the 1st driver.
How can I get the 2nd drive to show up in the Filesystem?
Michael
Status:
Closed (fixed)
Comments
Submitted by Locutus on Sun, 02/19/2012 - 15:06 Comment #1
Can you explain "you can only access the first one"? Access in what way?
Generally, before a HDD appears in the file system, you need to create (at least) one partition on it, format it with a filesystem, and mount it somewhere in your root filesystem.
Webmin has functions for all of that ("Hardware / Partitions on Local Disks", "System / Disk and Network Filesystems"). Otherwise you need to use the commands fdisk / parted, mkfs and mount, or rather edit /etc/fstab to have it auto-mounted on boot.
Submitted by mike8 on Sun, 02/19/2012 - 17:13 Comment #2
Well when I open the filesystem, it only lists the 1st 1.5TB drive, and shows 1273.4GB free space. So the 2nd 1.5TB drive doesn't even show up. I was hoping to use it as a Backup Drive.
When I go to("Hardware / Partitions on Local Disks") it lists both drives
Disk name Total size Make and model Partitions Actions
SATA device A 1.40 TB ATA ST31500341AS 2 IDE parameters | SMART status | Identify drive
SATA device B 1.40 TB ATA ST31500541AS 1 IDE parameters | SMART status | Identify drive
If I look at "Logical Volume Management" It shows "VolGroup 2.73TB" and "VolGroup00 1.36TB" under the Volume Groups Tab.
Under "Physical Volumes Tab" it lists "sda2 1.36 TB" and "sdb1 1.36 TB"
And under "Logical Volumes Tab" it lists "LogVol00 1.36 TB", and "LogVol01 5.81 GB"
And under ("System / Disk and Network Filesystems") looks like the attached file.
So it sees the drive, but it doesn't seem to be using it.
Submitted by andreychek on Sun, 02/19/2012 - 18:22 Comment #3
If it's there, and has a partition setup on it, you may just need to mount it.
Is it an internal drive, or a external USB drive?
And what is the output of this command:
mount
Submitted by mike8 on Sun, 02/19/2012 - 23:22 Comment #4
From the command "mount" I get this.
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,grpquota,usrquota)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
and it is an internal drive
Submitted by Locutus on Mon, 02/20/2012 - 04:33 Comment #5
Are you certain you need LVM for your purposes? It makes things a bit more complicated, as opposed to using simple partitions, especially when you don't exactly know what you need to do.
Generally you'd use LVM only if you plan to "shuffle around" your partitions later, like change their sizes, combine them, increase their size by adding more HDDs, things like this. But as I said it's not trivial to use properly, and wrong commands can easily kill your entire filesystem.
After what you described, there seems to be one volume group that spans both your HDDs and one that spans only one. Is "VolGroup00" some kind of "sub-group" to "VolGroup"? I'm not an expert with LVM myself unfortunately.
Anyway, it seems that there are logical volumes defined only for your root and swap file system, but none for the second HDD. You need to use Webmin's LVM section, or the "lvm" shell command, to create a logical volume on the second drive. Then you need to format that with e.g. ext4, and then mount it, like explained by Eric and me.
Submitted by andreychek on Mon, 02/20/2012 - 09:33 Comment #6
Also, what output do you get with this command: fdisk -l /dev/sdb
Submitted by mike8 on Mon, 02/20/2012 - 21:49 Comment #7
Here is what I get.
Device Boot Start End Blocks Id System /dev/sdb1 * 1 182402 1465137152 8e Linux LVM
I don't know anything about adding a vol, or mounting it in Linux so I'm lost here.
Michael
Submitted by andreychek on Mon, 02/20/2012 - 22:13 Comment #8
Is there anything at all on that second drive? Or can we format it and start over?
Submitted by mike8 on Tue, 02/21/2012 - 00:22 Comment #9
I didn't put anything on it unless someing was copyed to it durring installation. From what I can see it doesn't look like anything is on it..
Submitted by andreychek on Tue, 02/21/2012 - 11:25 Comment #10
That drive isn't mounted, so there shouldn't be anything necessary installed on it from the Virtualmin installation.
If you get stuck with making this work, we're happy to log into your system and assist -- however, knowing how to partition and format a drive in Linux is a good thing for a sysadmin to know, so we'd like to teach you how to do it :-)
It's just a few steps... to partition the disk, you can use 'fdisk' on your drive -- run this command (as root):
fdisk /dev/sdb
Delete the partition that shows up on there (using 'd'), create a new partition (using 'n'), and have it use the entire disk for that partition. Most of the time, the default options will be fine.
Once you've created the partition on /dev/sdb, quit and save by hitting 'w'.
Then, you can run this command to format your new partition:
mke2fs -j /dev/sdb1
Lastly, we need to setup a directory to mount it on and then mount it. You can do that with these two commands:
mkdir /mnt/backup
mount /dev/sdb1 /mnt/backup
And that's it!
Let us know if that works for you :-)
Submitted by mike8 on Tue, 02/21/2012 - 20:17 Comment #11
Well I think it worked. it lists the 2nd drive under the "mnt" folder, but thats op as long as I can access it and put my backups on that drive.
Michael
Submitted by andreychek on Tue, 02/21/2012 - 20:26 Comment #12
Okay, what is the output of the command "mount"? You should see /dev/sdb1 being mounted on /mnt/backup.
If so, you should be in good shape!
You can then go into Backup and Restore -> Scheduled Backups, and have it put backups each night onto your drive.
Also, you'll want to set it up to mount automatically at boot time. You can do that by going into Webmin -> System -> Disk and Network Filesystems... see how it says "No" under "Saved"? You want that to say "Yes".
Click the name "/mnt/backup", and where it says "Save Mount", click "Save and mount at boot", then click the "Save" button.
That will add it to /etc/fstab, so that your disk is mounted at boot time.
Submitted by mike8 on Tue, 02/21/2012 - 20:55 Comment #13
This is what I get.
/mnt/backup.
bash: /mnt/backup.: No such file or directory
Submitted by andreychek on Tue, 02/21/2012 - 23:37 Comment #14
Hmm, the command you'd want to run is "mount" -- that'll show all the mounted filesystems you have, and verify that things are indeed working as expected.
Submitted by mike8 on Wed, 02/22/2012 - 01:21 Comment #15
When I use "mount" I get this.
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,grpquota,usrquota)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
Submitted by andreychek on Wed, 02/22/2012 - 09:13 Comment #16
It looks like that drive is no longer mounted.
Whenever one of us logs in to look into that connectivity check issue, we can also just add your mount to /etc/fstab for you.
Submitted by mike8 on Wed, 02/22/2012 - 15:59 Comment #17
OK I have been messing with this to 3 days.
Michael
Submitted by andreychek on Wed, 02/22/2012 - 16:54 Comment #18
Well, it sounds like it was working at one point, you may have just rebooted, which would have unmounted it if you didn't tell it to mount that at boot time.
You can run this command to mount it again:
mount /dev/sdb1 /mnt/backup
However, whenever Jamie or I logs into your system, we can make sure it's mounted and added to your systems bootup.
Submitted by JamieCameron on Wed, 02/22/2012 - 19:16 Comment #19
Is your drive still connected? I logged in your system, but
fdisk -l
isn't showing it.Also, when I run
grep sdb /var/log/messages
I see many many errors from the kernel reading that disk!Submitted by mike8 on Wed, 02/22/2012 - 19:42 Comment #20
The drive is still there, the only think I did was run the commands that andreychek gave me earlier.
As soon as I did the drive disappeared. Also It was a new drive, so I know it was good. How can I get it back?
Michael
Submitted by JamieCameron on Wed, 02/22/2012 - 19:45 Comment #21
You might want to try rebooting - however, your system certainly isn't detecting it properly at the moment.
Is this an internal drive, or USB?
Submitted by mike8 on Wed, 02/22/2012 - 19:47 Comment #22
Its a internal 1.5TB drive, I will try rebooting to see what happens.
Submitted by mike8 on Thu, 02/23/2012 - 00:10 Comment #23
If I go to "Webmin/Hardware/Partitions on Local Disks" it show both harddrivers as having a partition, it just doesn't show up. as
Submitted by andreychek on Thu, 02/23/2012 - 10:40 Comment #24
Okay, so if you run this command now:
mount /dev/sdb1 /mnt/backup
Does /dev/sdb1 show up as mounted if you run the command "mount"?
Submitted by mike8 on Thu, 02/23/2012 - 13:22 Comment #25
Here is the output.
mount /dev/sdb1 /mnt/backup
mount: special device /dev/sdb1 does not exist
[root@host ~]#
[root@host ~]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,grpquota,usrquota)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
Submitted by andreychek on Thu, 02/23/2012 - 14:58 Comment #26
Well, something was a little strange with one of the partitions on the drive -- that might be related to the errors that Jamie saw previously.
However, I was able to mount it, it's now on /mnt/backup again, and I added it to your /etc/fstab.
Those sorts of errors are unusual though, so you may just need to keep an eye on that drive.
Submitted by mike8 on Thu, 02/23/2012 - 15:42 Comment #27
Looks like its working, at least the backup folder in in "mnt" So I moved my backups to that folder. and well keep an eye on it to see how it goes.
Thank you Michael
Submitted by mike8 on Fri, 02/24/2012 - 22:21 Comment #28
Well the backups are working, so far everything looks like it is fixed.
Thank you.
Michael
Submitted by mike8 on Sat, 03/17/2012 - 00:36 Comment #29