3

We have linux box running fedora. It has a small laptop hard drive running the OS and a 3ware RAID controller running 3 SATA drives RAID 5.

When we boot the computer and login, I run “fdisk –l” and it lists all the hda partitions. No /dev/sda. If I run “modprobe 3w-9xxx” and then run “fdisk –l” again, it shows all the hda1 through hda7 partitions with a single /dev/sda Obviously the /dev/sda isn’t mounted to a folder, nor is it formatted.

I checked the /etc/fstab file and it has the line: /dev/vbackup/lvbackup /backups xfs defaults 1 2

I’m guessing this means the /backups folder is mounted to this device /dev/vbackup /lvbackup

I know you need to format the drive using “mkfs.xfs –f /dev/sda” but I forget what to do is get /dev/sda to be /dev/vbackup/lvbackup to be mounted to /backups

Thanks in advance

here is the output for the /var/log/messages file

Aug 7 kernel: 3ware 9000 Storage Controller device driver for Linux v2.26.05.003-2.6.21. 
Aug 7 kernel: ACPI: PCI Interrupt 0000:04:0c.0[A] -> GSI 16 (level, low) -> IRQ 18 
Aug 7 kernel: 3w-9xxx: scsi1: Found a 3ware 9000 Storage Controller at -xfc5ffc00, IRQ: 18 
Aug 7 kernel: 3w-9xxx: scsi1: Firmware FE9X 2.08.00.006, BIOS BE9X 2.03.01.052, Ports: 8. 
Aug 7 kernel: scsi 1:0:0:0: Direct-Access AMCC 9500S-8 DISK 2.08 PQ: 0 ANSI: 3 
Aug 7 kernel: sd 1:0:0:0: [sda] 1953083392 512-byte hardwaresectors (999979 MB) 
Aug 7 kernel: sd 1:0:0:0: [sda] Write Protect is off 
Aug 7 kernel: sd 1:0:0:0: [sda] Write cache: enabled, read cache disabled, doesn't support DPO or FUA 
Aug 7 kernel: sd 1:0:0:0: [sda] 1953083392 512-byte hardware sectors (999979 MB) 
Aug 7 kernel: sd 1:0:0:0: [sda] Write Protect is off 
Aug 7 kernel: sd 1:0:0:0: [sda] Write cache: enabled, read cache disabled, doesn't support DPO or FUA 
Aug 7 kernel: sd 1:0:0:0: [sda] Write cache: enabled, read cache: disabled, doesn't support DPO or FUA 
Aug 7 kernel: sd 1:0:0:0: sda : unknown partition table 
Aug 7 kernel: sd 1:0:0:0: sd 1:0:0:0: [sda] Attached SCSI disk 
Aug 7 kernel: sd 1:0:0:0: sd 1:0:0:0: Attached scsi generic sg0 type 0 
Aug 7 scsi.agent[3511]: disk at /devices/pci0000:00/0000:00:1e.0/0000:03:02.0/0000:04:0c.0/host1/target1:0:0/1:0:0:0 
Aug 7 kernel: XFS mounting filesystem sda 

Blockquote

phill
  • 327

5 Answers5

5

Careful! The advice given so far ignores the fact that it appears you have a disk partitioned using lvm. Formatting this may loose data!

Try the commands lvdisplay, pvdisplay, vgdisplay.

You can create an lvm volume without partitioning the drive. It may already be configured and mounted at that location.

Checked the /etc/fstab file and it has the line: /dev/vbackup/lvbackup /backups xfs defaults 1 2

I’m guessing this means the /backups folder is mounted to this device /dev/vbackup /lvbackup

No, the drive /dev/sda is added as a physical volume in the volume group "vbackup". The logical volume "lvbackup" has been created in this volume group. The logical volume ("/dev/vbackup/lvbackup") is mounted on the folder /backups.

If it's not formatted (which I suspect it already is), you would format the logical volume mkfs.xfs /dev/vbackup/lvbackup, then mount it.

I repeat - Do not partition the drive with fdisk. Do not format the drive with mkfs. I strongly suspect it's already formatted and mounted. It's running lvm on the raw drive, and so isn't partitioned either.

Read up on lvm.

If it's already configured, but just didn't come up with the raid controller, try this:

vgchange -a y

mount /backups

Alternatively... Due warnings aside, let's assume you have a new (replacement?) drive and you want it to mount in place of the old drive. Here's the commands you'd use to replicate the prior config (as best I can tell from fstab.)

pvcreate /dev/sda

vgcreate vbackup /dev/sda

lvcreate -L 900G -n lvbackup vbackup

vgchange -a y

mkfs.xfs /dev/vbackup/lvbackup

mount /dev/vbackup/lvbackup /backups

Good luck!

2

Simpler way to use parted. Assuming the drive to partition is /dev/sda: To create partition start GNU parted as follows:

parted /dev/sda
Creates a new gpt disklabel
mklabel gpt
Create 4GB partition size:
mkpart primary 0 4G
Quit and save the changes:
quit
Use mkfs to format file system:
sudo mkfs.xfs /dev/sda1
Mount it :
sudo mkdir /backup && sudo mount -t xfs /dev/sda1 /backup
Ali Mezgani
  • 3,870
1

You need to use fdisk to partition it, the different numbers (ie /dev/sda1) are for different partitions. Here is a link to a partitioning tutorial using fdisk.

Then once you have the partitions, you can use the mkfs programs to create the filesystem on that partition. Once you have done that, you can mount it.

Kyle Brandt
  • 85,693
1

When we boot the computer and login, I run “fdisk –l” and it lists all the hda partitions.

OK

No /dev/sda.

If I run “modprobe 3w-9xxx” and then run “fdisk –l” again, it shows all the hda1 through hda7 partitions with a single /dev/sda

Hm, when you loaded the appropriate kernel module the device /dev/sda showed up, so far so good. If you don't see /dev/sda1, etc. it means your drive is not partitioned yet.

Obviously the /dev/sda isn’t mounted to a folder, nor is it formatted.

Maybe, but there is no way to learn that from fdisk -l. What does mount say?

I checked the /etc/fstab file and it has the line: /dev/vbackup/lvbackup /backups xfs defaults 1 2

/dev/vbackup/lvbackup is another story, but let's see.

I’m guessing this means the /backups folder is mounted to this device /dev/vbackup /lvbackup

I'd say the device /dev/vbackup/lvbackup will be mounted to the directory /backups either at boot or if you do mount -a. I doesn't say that it is currently mounted. Use either /etc/mtab or mount to find that out.

I know you need to format the drive using “mkfs.xfs –f /dev/sda”

You usually want to format a partition like /dev/sda1 and not /dev/sda.

but I forget what to do beyond that as far as getting the drive properly mounted to a different device name? Any ideas?

Actually you can't mount a drive to a device name. The device name is created by the system for you, either at start up or when the driver is loaded. You can influence this but it has nothing to do with mounting.

0

Would symlinking work in this case? I have never done it with devices before

ln -s /dev/vbackup/lvbackup /dev/sdXn 

You could then use /dev/sdXn in your fstab

RateControl
  • 1,207