accessing a 2nd hard drive?

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

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.

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.

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

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

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.

Also, what output do you get with this command: fdisk -l /dev/sdb

Here is what I get.

Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes 255 heads, 63 sectors/track, 182401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

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

Is there anything at all on that second drive? Or can we format it and start over?

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..

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 :-)

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

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.

This is what I get.

/mnt/backup.
bash: /mnt/backup.: No such file or directory

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.

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)

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.

OK I have been messing with this to 3 days.

Michael

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.

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!

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

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?

Its a internal 1.5TB drive, I will try rebooting to see what happens.

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

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"?

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)

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.

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

Well the backups are working, so far everything looks like it is fixed.

Thank you.

Michael