Linux – how do you mount and format /dev/sda to a different /dev/ name

3warefdiskfedoralinuxsata

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

Best Answer

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!