Score:0

How do I add a SCSIdisk that has data I want to keep?

ng flag

I try to mount a scsi disk in the sysmtem,but something wrong on it. below was my step to mount disk.

#mount /dev/sda /mnt enter image description here

#mkfs.ext4 /dev/sda enter image description here

hdd list enter image description here

digiwizkid avatar
cn flag
Please replace terminal images with text.
ng flag
Create a new partition by gdisk or fdisk , but I cannt see new /sda1 in the lsblk list.
raj avatar
cn flag
raj
You tried to mount the entire disk (`/dev/sda`) instead of the partition that contained the data, which obviously could not succeed. Then you reformatted the disk by `mkfs`, effectively destroying all data on it.
ng flag
Could you please share right step how to mount SMR drive ? thanks.
Score:2
cc flag

Normally, disk devices have their storage broken up into partitions which have filesystems. Assuming sda is your scsi disk, see what partitions it has with the command (without sudo if you are running as root):

sudo gdisk -l /dev/sda

The output should list one or more partitions, and their size and type.

The mount command should be issued with the -t options to specify the filesystem type, e.g. -t ext4, or -t ntfs or -t vfat etc. of the partition selected to mount:

sudo mount -t ext4 /dev/sda1 /mnt

Another mount option that might be of interest is -o ro to mount read-only.

Unfortunately it looks like you formatted the /dev/sda, so any data on it was overwritten. Lets hope that your scsi disk was not sda, and that sda didn't contain anything of value to you.


Formatting the device sda instead of a partition like sda1 wipes out the partition table in addition to any data on the disk. Whatever you did before the mkfs was wiped.

ng flag
I created a new partition for /dev/sda by gdisk or fdisk,but I cannot see the /dev/sda1 in the lsblk list.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.