How can I read files from /dev/sdc

I have Ubuntu 20.10 installed on my lowly AMD i5 machine, I also have 3 drives 1 x HDD. 2 x SSD drives. I boot from the HDD and I want to read files on the /dev/sdc drive. Please how do I do this. In Windows I can simply CD/D then do anything with what is there, surely Ubuntu must have some way of doing the same.? Thank you all in advance
Rod.

1 Like

Try a couple terminal commands:

Blockquote
sudo fdisk -l

sudo mkdir /mnt/ssdc
sudo mount /dev/sdc /mnt/ssdc

cd /mnt/ssdc
ls

2 Likes

If you need to acces that drive from your Linux temporarily, do what @TrekJunky suggested, but mount a partition on the disc, such as /dev/sdc1, not really just /dev/sdc. Alternatively, if you open the file manager on GUI, on the left side among "devices"you should see that drive. Click on it, and it will be automatically mounted after you entered your password. Do what you need at the moment, then unmount the drive…

If you need to access that drive from your Linux regularly and constantly, it’s better to mount it at boot time, for that you need to edit /etc/fstab.
We can help you how to edit your fstab, but need some info:

  • output of sudo lsblk
  • output of sudo parted -l
  • a mount point which is comfortable for you…
4 Likes

This is the error I got when I tried Cane’s help.
rod@rod:~$ sudo mkdir /mnt/ssdc
rod@rod:~$ sudo mount /dev/sdc/ssdc
mount: /dev/sdc/ssdc: can’t find in /etc/fstab.
I also tried the advice from Laszlo, but no uck. I will put the 3 requested files below
1: sda 8:0 0 1.8T 0 disk
├─sda1 8:1 0 1G 0 part /boot/efi
└─sda2 8:2 0 1.8T 0 part /var/snap/firefox/common/host-hunspell
/snap
/
sdb 8:16 0 447.1G 0 disk
└─sdb3 8:19 0 446.6G 0 part
sdc 8:32 0 223.6G 0 disk
├─sdc1 8:33 0 223.5G 0 part
├─sdc2 8:34 0 47.1M 0 part
└─sdc3 8:35 0 223.6G 0 part

[sudo] password for rod:
Model: ATA ST2000VN004-2E41 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 1128MB 1127MB fat32 boot, esp
2 1128MB 2000GB 1999GB ext4

Model: ATA KINGSTON SA400S3 (scsi)
Disk /dev/sdb: 480GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Any mount point you suggest will be quite fine by me, thank you

2 Likes

OK… the advice was a bit brief and you were not able to follow it correctly.

You have a disc called sdc, and it contains a partition called sdc1… at least we are assuming that. So lets check

Can you show us the output of
lsblk
it will list all block devices, that is all your disk partitions, whether they are mounted or not.
When we see that, we will be able to correctly identify what is on that sdc disk… we are guesseing there is a partition called sdc1… we need to be sure.

4 Likes

It’s here, I gathered some information from it:

So there are 3 partitions there, I guess sdc1 and sdc3 would be interesting for @Rodney_Jackson , but not sure now which, or maybe both.

The parted -l output from Rod seems to be truncated, I see only sda there.

My bad: I forgot to ask for the output of sudo blkid, which will contain the UUID’s needed for fstab entries :wink:

@Rodney_Jackson : I suspect you have Windows quick startup enabled.
Please disable it to be able to mount the drives in Linux used by your Windows installation.

If you have this option enabled in Windows, it does not really shut down, and so the drives it handles seem always to be in an ungracefully detached dirty state.

1 Like

No Windows was just a reference, I only use Ubuntu.
To answer Neville Jackson’s question, here is the output of lsblk.

rod@rod:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 74.1M 1 loop /snap/core22/1033
/snap/core22/1033
loop1 7:1 0 4K 1 loop /snap/bare/5
/snap/bare/5
loop2 7:2 0 240.5M 1 loop /snap/firefox/3216
/snap/firefox/3216
loop3 7:3 0 73.9M 1 loop /snap/core22/864
/snap/core22/864
loop4 7:4 0 11.2M 1 loop /snap/firmware-updater/109
/snap/firmware-updater/109
loop5 7:5 0 497M 1 loop /snap/gnome-42-2204/141
/snap/gnome-42-2204/141
loop6 7:6 0 91.7M 1 loop /snap/gtk-common-themes/1535
/snap/gtk-common-themes/1535
loop7 7:7 0 10.5M 1 loop /snap/snap-store/1046
/snap/snap-store/1046
loop8 7:8 0 40.9M 1 loop /snap/snapd/20290
/snap/snapd/20290
loop9 7:9 0 40.4M 1 loop /snap/snapd/20671
/snap/snapd/20671
loop10 7:10 0 452K 1 loop /snap/snapd-desktop-integration/83
/snap/snapd-desktop-integration/83
sda 8:0 0 1.8T 0 disk
├─sda1 8:1 0 1G 0 part /boot/efi
└─sda2 8:2 0 1.8T 0 part /var/snap/firefox/common/host-hunspell
/snap
/
sdb 8:16 0 447.1G 0 disk
└─sdb3 8:19 0 446.6G 0 part
sdc 8:32 0 223.6G 0 disk
├─sdc1 8:33 0 223.5G 0 part
├─sdc2 8:34 0 47.1M 0 part
└─sdc3 8:35 0 223.6G 0 part
sr0 11:0 1 1024M 0 rom
sr1 11:1 1 1024M 0 rom
rod@rod:~$

I hop this throws some light on my problem. It started when the trash folder was accidently deleted, then the Firefox would not load, then the Terminal threw errors. So I employed an old HDD (/sda) and run ubuntu from that, but I have many files and folders on the other 2 SSD’s, this is why I want to be able to access them.
Rod.

Oh I see.
Ok.

Let’s try this:

sudo su
mount /dev/sdc3 /mnt/ssdc
apt install mc
cd /mnt/ssdc
mc

Now you should have a Midnight Commander open, and you should see the contents of your drive.
Please note, that the mount has 2 parameters separated with a space character:
mount [SPACE] <what to mount: /dev/sdc3 in this case>[SPACE]<the mount point where to mount: /mnt/ssdc now, as you created this directory when tried @TrekJunky 's suggestion>

Did this work?

1 Like

Thank you Laszlo, again I get an error message.
rod@rod:~$ sudo su
[sudo] password for rod:
root@rod:/home/rod# mount /dev/sdc3 /mnt/ssdc
mount: /mnt/ssdc: wrong fs type, bad option, bad superblock on /dev/sdc3, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
root@rod:/home/rod#

Something is wrong there.
sudo parted -l /dev/sdc
What does output?
Also lookup SMART:

sudo apt install smartmontools
sudo smartctl -Ai /dev/sdc

What does smartctl say?

1 Like

Hello Laszlo, I have put the two requests back to front, I will include them both…
rod@rod:~$ sudo smartctl -Ai /dev/sdc
smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.5.0-14-generic] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family: WD Blue / Red / Green SSDs
Device Model: WDC WDS240G2G0A-00JH30
Serial Number: 1851B0803093
LU WWN Device Id: 5 001b44 8b90aeb2f
Firmware Version: UF450000
User Capacity: 240,065,183,744 bytes [240 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
TRIM Command: Available, deterministic
Device is: In smartctl database 7.3/5319
ATA Version is: ACS-2 T13/2015-D revision 3
SATA Version is: SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Mon Jan 22 20:41:33 2024 AEDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0x0032 100 100 000 Old_age Always - 0
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 10631
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 2215
165 Block_Erase_Count 0x0032 100 100 000 Old_age Always - 2136
166 Minimum_PE_Cycles_TLC 0x0032 100 100 — Old_age Always - 25
167 Max_Bad_Blocks_per_Die 0x0032 100 100 — Old_age Always - 0
168 Maximum_PE_Cycles_TLC 0x0032 100 100 — Old_age Always - 28
169 Total_Bad_Blocks 0x0032 100 100 — Old_age Always - 212
170 Grown_Bad_Blocks 0x0032 100 100 — Old_age Always - 0
171 Program_Fail_Count 0x0032 100 100 000 Old_age Always - 0
172 Erase_Fail_Count 0x0032 100 100 000 Old_age Always - 0
173 Average_PE_Cycles_TLC 0x0032 100 100 000 Old_age Always - 25
174 Unexpected_Power_Loss 0x0032 100 100 000 Old_age Always - 1001
184 End-to-End_Error 0x0032 100 100 — Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
188 Command_Timeout 0x0032 100 100 — Old_age Always - 0
194 Temperature_Celsius 0x0022 068 046 000 Old_age Always - 32 (Min/Max 5/46)
199 UDMA_CRC_Error_Count 0x0032 100 100 — Old_age Always - 0
230 Media_Wearout_Indicator 0x0032 100 100 000 Old_age Always - 0x060a0500060a
232 Available_Reservd_Space 0x0033 100 100 005 Pre-fail Always - 100
233 NAND_GB_Written_TLC 0x0032 100 100 — Old_age Always - 6214
234 NAND_GB_Written_SLC 0x0032 100 100 000 Old_age Always - 16288
241 Host_Writes_GiB 0x0030 100 100 000 Old_age Offline - 6649
242 Host_Reads_GiB 0x0030 100 100 000 Old_age Offline - 9504
244 Temp_Throttle_Status 0x0032 000 100 — Old_age Always - 0

rod@rod:~$ sudo parted -l
Model: ATA ST2000VN004-2E41 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 1128MB 1127MB fat32 boot, esp
2 1128MB 2000GB 1999GB ext4

Model: ATA KINGSTON SA400S3 (scsi)
Disk /dev/sdb: 480GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
3 540MB 480GB 480GB ext4 lvm

Warning: The disk CHS geometry (919367,255,2) reported by the operating system
does not match the geometry stored on the disk label (29186,255,63).
Ignore/Cancel?

Sorry, I did not see that.
So Rodney has 3 partitions on sdc
We need to do this one step at a time with Rodney, so

@Rodney_Jackson
Can you tell us which of those 3 partitons you wish to mount?
and
Do you know what type of filesystem ( eg ext4) is on those partitions?

If you dont know the filesystem type, you need to use th e
blkid
command.
You may have to install it first.

Here is an example of a blkid output

...
/dev/sda1: LABEL="LinuxRHsda1" UUID="6c2937a7-9125-4bd2-9127-0c2d84a4b7f2" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="LinuxRHsda1" PARTUUID="6c3cdecc-1bc2-450d-90a8-2993be6f53b8"
....

You can see it tells me that my sda1 is an ext4 partition and t gives me the UUID number… we will need that UUID number if you want to automatically mount it using /etc/fstab. To mount it manually all we need to know is that it is an ext4 ( or whatever) filesystem.

So lets sort that out, then we can tell you exactly what to type to get a manual mount of your partition.

1 Like

I also would like to be sure about the partition itself.
Based on the sizes reported by lsblk I suspect that it’s about an extended extended partition (sdc1) that holds logical partitions (sdc2,sdc3).
Otherwise there are overlapping partitions, which would be a defective thing anyway.

Unfortunately parted -l stopped at sdb because of geometry mismatch, so still don’t have a clue about partition layout from sdc. :frowning:

1 Like

Hi Neville, I did a blkid and it showed only sda1, so I tried sudo blkid and the results are as below. I think the reason I abandoned the original drives and installed ubuntu on an old HDD might be because the first 2 drives may be beyond saving. Anyway, here is the output.

rod@rod:~$ sudo blkid
[sudo] password for rod:
/dev/sda2: UUID=“44b8c71f-3dde-4f34-978a-807446c4a0fc” BLOCK_SIZE=“4096” TYPE=“ext4” PARTUUID=“43995596-9e3c-4037-b927-ab4c9d8643e5”
/dev/loop1: BLOCK_SIZE=“131072” TYPE=“squashfs”
/dev/loop8: BLOCK_SIZE=“131072” TYPE=“squashfs”
/dev/sdb3: UUID=“e1b345da-b218-446f-a5fd-967ff2b89ee1” BLOCK_SIZE=“4096” TYPE=“ext4” PARTUUID=“8b5a41ae-ba33-4bcc-b8d6-21447bc29e7a”
/dev/loop6: BLOCK_SIZE=“131072” TYPE=“squashfs”
/dev/loop4: BLOCK_SIZE=“131072” TYPE=“squashfs”
/dev/loop2: BLOCK_SIZE=“131072” TYPE=“squashfs”
/dev/loop0: BLOCK_SIZE=“131072” TYPE=“squashfs”
/dev/loop9: BLOCK_SIZE=“131072” TYPE=“squashfs”
/dev/sdc3: PTTYPE=“sun”
/dev/sdc1: PTTYPE=“sun”
/dev/loop7: BLOCK_SIZE=“131072” TYPE=“squashfs”
/dev/sda1: UUID=“F4E9-B6EA” BLOCK_SIZE=“512” TYPE=“vfat” PARTUUID=“5b514a21-7904-4c94-84ba-a1c242947698”
/dev/loop5: BLOCK_SIZE=“131072” TYPE=“squashfs”
/dev/loop3: BLOCK_SIZE=“131072” TYPE=“squashfs”
/dev/loop10: BLOCK_SIZE=“131072” TYPE=“squashfs”

Hi @Rodney_Jackson ,
I don’t know what happened to your disk.
I never have seen blkid reporting that partition type.
Looking at the SMART I was not able to spot something that would suggest hw. defect of the disc. Lets assume the disk is OK.
But something is severely corrupted.
If I had that disk, and I had some precious data on it, I would try to save it with CG Security’s Testdisk / Photorec.
Then repartition and reformat.
The best I can recomnend for you now is that.
.TestDisk Download - CGSecurity
Linux distros usually have this tool in the repository.

1 Like

Do what Laszlo says.

You seem to have one partition , sdb3, that might be readable, blkid gives the filesystem type as ext4.

We might try with that one.
Make a mount point
sudo mkdir /mnt/rodney
you can call it whatever you like
Then try to mount sdb3 to it
sudo mount -t ext4 /dev/sdb3 /mnt/rodney
I am specifying a filesystem type of ext4

Let us know how that goes. If it fails, the partition sdb3 probably does not contain a recognizable filesystem.
It should show up as mounted when you do a df.

If it is there, you can do
cd /mnt/rodney
ls
and you should see all the files on it.

Anyway, that is how you do a mount, whether it works or not
depends on what is on that partition.
You can try with sdc1 or sdc3 if you want… just try a mount statement without specifying filesystem type eg
mount /dev/sdc1 /mnt/rodney
it may be able to mount it.

I do note that what you really want to do is read the files on the sdc disk. What you have there is an enigma, as Laszlo says. I thought you might at least have a practice with sdb3, just to learn how to do mounts. Before you try, check that sdb3 is not already mounted.

1 Like

It seems to kick me in the rear end every time. see attached.

rod@rod:~$ sudo mount -t ext4 /dev/sdb3 /mnt/rodney
mount: /mnt/rodney: mount(2) system call failed: Structure needs cleaning.
dmesg(1) may have more information after failed mount system call.
rod@rod:~$ cd /mnt/rodney
rod@rod:/mnt/rodney$ ls -l
total 0
Rod.

Run fsck on it.
sudo fsck /dev/sdb3

Answer fixing questions with “a”, that will answer all similar question with yes - and hope the best, fingers crossed, say your prayer, etc…
Then retry mounting it.

Wait!

Don’t do anything!
Did you have an LVM before by any chance?

If yes, I will create a 2 disk LVM in a VM, intentionally corrupt the system, and I’ll try to reconstruct it. But this takes time, so I wait for your positive answer that you had a LVM setup. Additionally my trial has to be successful to provide you some steps to follow. But until that that just don’t touch those disks!

2 Likes

There is something unusual about that disk.
Do what Laszlo says

Hello Laszlo I did as suggesr=ted and /dev/sdb3 is now mounted but it suggested I read

dmesg(1) may have more information after failed mount system call.
root@rod:/home/rod# dmesg

That gives stacks of lines of data, I will show the first half dozen lines.

[ 0.000000] microcode: updated early: 0xca → 0xf8, date = 2023-02-23
[ 0.000000] Linux version 6.5.0-14-generic (buildd@lcy02-amd64-031) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0, GNU ld (GNU Binutils for Ubuntu) 2.41) #14-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 14 14:59:49 UTC 2023 (Ubuntu 6.5.0-14.14-generic 6.5.3)
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-6.5.0-14-generic root=UUID=44b8c71f-3dde-4f34-978a-807446c4a0fc ro quiet splash vt.handoff=7