Unable to access external hard drive

I saved a copy of windows software on my external hard drive now I am unable to open my external .
I don’t have windows installed on my pc .
The only way I can see my external is through my terminal

 linux-qe07:/home/warren # fdisk -l
  
 
 ** Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors**
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0x675e5be7
  
 
  Device     Boot     Start       End   Sectors   Size Id Type
  /dev/sda1  *    402733056 549535743 146802688    70G 83 Linux
  /dev/sda2       207671296 218161739  10490444     5G 82 Linux swap / Solaris
  /dev/sda3       549535744 976773167 427237424 203.7G 83 Linux
  /dev/sda4            2048 207671295 207669248    99G  f W95 Ext'd (LBA)
  /dev/sda5            4096  33703935  33699840  16.1G 83 Linux
  /dev/sda6        33705984 207671295 173965312    83G 83 Linux
  
 
  Partition table entries are not in disk order.
 **Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors**
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  

My external is sdb
Is there a command for me to cd to my external to remove this file
Normally I would have right clicked on a folder in my external & got the address from properties but that won’t work now.

To conduct further analysis some more information might be helpful:

  1. Does your post show the complete output of “fdisk -l”, especially as far as /dev/sdb is concerned ?
  2. What does YaST2 tell about your external drive?
  3. What kind of “external” ist your drive (USB2.0, USB3,0, eSATA, …)?
  4. What filesystem do you use on your external drive (NTFS)?
  5. Did you copy the files while using MS Windows or while using linux?
  6. Can you mount your external drive with linux? (If not, what error messages do you get?)
  7. Is ntfs-3g installed on your linux system (only if your external drive uses NTFS as file system)?

Some information on your “linux” (openSUSE xx.y, ubuntu, …; KDE x.yy, Gnome x,yy, …) could also be of assistance.

Best regards

susejunky

On 2014-11-29 14:36, Hermes14 wrote:

> Code:
> --------------------
> linux-qe07:/home/warren # fdisk -l

> Partition table entries are not in disk order.
> Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
>
> --------------------

No partitions? Was that the full output?

Please post output of “file -s /dev/sdb” and:


lsblk --output NAME,KNAME,RA,RM,RO,SIZE,TYPE,FSTYPE,LABEL,PARTLABEL,MOUNTPOINT,UUID,PARTUUID,WWN,MODEL,ALIGNMENT /dev/sdb


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

That already look strange to me.

Here’s what I am seeing for “/dev/sdb”:


# fdisk -l /dev/sdb

Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 684408B5-6977-4175-A06C-5A6CED930275

Device       Start       End   Sectors  Size Type
/dev/sdb1     2048   1026047   1024000  500M EFI System
/dev/sdb2  1026048   2050047   1024000  500M Linux filesystem
/dev/sdb3  2050048   3074047   1024000  500M Linux filesystem
/dev/sdb4  3074048   4098047   1024000  500M Linux filesystem
/dev/sdb5  4098048 528386047 524288000  250G Linux LVM

Notice that my 1T drive has a physical sector size of 4096, while yours has a physical sector size of 512.

I’m not sure if they even make 1T drives with a physical sector size of 512.

On 2014-11-29 17:06, nrickert wrote:
> I’m not sure if they even make 1T drives with a physical sector size of
> 512.

Yes, they do. I don’t have one connected this instant, though.

This is more typical, though:


Disk /dev/sde: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

My external hard drive is a Transcend Storejet 35 ultra
http://www.memoryc.com/storage/externalharddrive/1tbtranscendstorejet35ultra.html
I bought it a few years back when the 1TB first came out & was working fine until I tried to save a copy of my partner’s window7 cd on it.
this is the full output
I didn’t partition it as I am only using it as a storage facility mainly for archiving & back ups.

linux-qe07:/ # fdisk -l
 Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disklabel type: dos
 Disk identifier: 0x675e5be7
 
 
 Device     Boot     Start       End   Sectors   Size Id Type
 /dev/sda1  *    402733056 549535743 146802688    70G 83 Linux
 /dev/sda2       207671296 218161739  10490444     5G 82 Linux swap / Solaris
 /dev/sda3       549535744 976773167 427237424 203.7G 83 Linux
 /dev/sda4            2048 207671295 207669248    99G  f W95 Ext'd (LBA)
 /dev/sda5            4096  33703935  33699840  16.1G 83 Linux
 /dev/sda6        33705984 207671295 173965312    83G 83 Linux
 
 
 Partition table entries are not in disk order.
 Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes                                                                                                                            
 I/O size (minimum/optimal): 512 bytes / 512 bytes   

Under hardware information this is what I get for my external hard drive

 >> block.5.2: /dev/sda serial
   serial id len: 20
   block: name = sdb, path = /class/block/sdb
     dev = 8:16
     range = 16
     block device: bus = scsi, bus_id = 4:0:0:0 driver = sd
       path = /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/host4/target4:0:0/4:0:0:0
     vendor = StoreJet
     model = Transcend
     rev =  
     type = 0
 >> block.5: /dev/sdb
 >> block.5.1: /dev/sdb geo
   dev = /dev/sdb, fd = 3
   open ok, fd = 3
 /dev/sdb: ioctl(geo) ok
 /dev/sdb: ioctl(block size) ok
 /dev/sdb: ioctl(disk size) ok
 >> block.5.2: /dev/sdb serial
   serial id len: 1
   block: name = sr0, path = /class/block/sr0
     dev = 11:0
     range = 1
     block device: bus = scsi, bus_id = 0:0:0:0 driver = sr
       path = /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0
     vendor = Optiarc
     model = DVD RW AD-7280S
     rev = 1.01
     type = 5
 

Hi Robin

 linux-qe07:/home/warren # file -s /dev/sdb
 /dev/sdb: data
 linux-qe07:/home/warren # lsblk --output NAME,KNAME,RA,RM,RO,SIZE,TYPE,FSTYPE,LABEL,PARTLABEL,MOUNTPOINT,UUID,PARTUUID,WWN,MODEL,ALIGNMENT /dev/sdb
 NAME KNAME  RA RM RO   SIZE TYPE FSTYPE LABEL PARTLABEL MOUNTPOINT UUID PARTUUID WWN MODEL            ALIGNMENT
 sdb  sdb   128  0  0 931.5G disk                                                      Transcend               0
 linux-qe07:/home/warren #
 

Sorry I forgot to mention I remove windows about a year ago on this computer.
Only by bios is windows.

Hi Hermes14,

this

tells us that your external drive is capable of eSATA and USB2.0 and this

looks like you connect it via USB. And you say

and

So i guess the copying took place when you used linux. How exactly did you do it? Did you do it with “dd” or was the drive mounted and you used some sort of “copy” (e.g. “cp”)? What filesystem is the external drive formatted with?

Best regards

susejunky

 	 	 	   When I bought it I reformatted it to remove all the windows software from it.

The only time I used bash is when I cloned a Linux partition, & they were mainly Opensuse13,1 so I don’t really need those backups anymore.
I copied windows with control + C, the pasted it with control + V.
I think I then compressed it with gzip (right clicked on the folder then selected compress; gzip)

If I can remember correctly I think the file system was & would still be NTFS.

I was looking at mounting my external but then I would have to create sdb1 which would not help me at all my stuff is in sdb.

Hi Hermes14,

Did you do this while running MS Windows or while running linux? In case you were running linux, which tool did you use for reformatting (YaST2, mkfs.nnnn, …)?
However, you are sure that in the end there was (and still is) just one partition with NTFS as filesystem on your external hard drive. Correct?

Could you please describe precisely what you did:

  • Did you run linux or MS Windows when you did the “cloning”?
  • What tool did you use for “cloning”?

I guess this means you used “dolphin” to do the copying. Correct? If so, at this very time you must have been able to mount your drive. This leads us to the very important question:
Did you “clone” your Linux partitions after you saved a copy of windows software on your external hard drive or before?

As far as i understand your problem at the moment i would say that there is no partition table on your external hard drive (probably lost while “cloning” your linux partitions).

But to be sure could you please do the following:

  1. Open "YaST2
    " and select “Partitioner”. On the left panel select Hard Disks -> sdb and then on the right panel select the tab “Overview”. Do a screenshot and post it here. Then press the button “Properties (hdparm)…”. Again do a screenshot and post it here. 1. Unplug your hard drive and plug it in again. Then do
journalctl -n 20

and post the result here.

Best regards

susejunky

On 2014-11-30 13:26, susejunky wrote:

> But to be sure could you please do the following:
>
>
> - Open “-YaST2-” and select “-Partitioner-”. On the left panel select
> -Hard Disks- -> -sdb- and then on the right panel select the tab
> “-Overview-”. Do a screenshot and post it here. Then press the button

Notice that fdisk and lsblk said there is nothing in that disk, so the
partitioner can not say differently. And “file” saw nothing either.

> linux-qe07:/home/warren # file -s /dev/sdb
> /dev/sdb: data
> linux-qe07:/home/warren # lsblk --output NAME,KNAME,RA,RM,RO,SIZE,TYPE,FSTYPE,LABEL,PARTLABEL,MOUNTPOINT,UUID,PARTUUID,WWN,MODEL,ALIGNMENT /dev/sdb
> NAME KNAME RA RM RO SIZE TYPE FSTYPE LABEL PARTLABEL MOUNTPOINT UUID PARTUUID WWN MODEL ALIGNMENT
> sdb sdb 128 0 0 931.5G disk Transcend 0
> linux-qe07:/home/warren #

Seeing as model “trascend” makes me wonder if this is an external disk
in a box? I would try, anyway, to replace the cable, be it usb or sata.

> “-Properties (hdparm)…-”. Again do a screenshot and post it here.
> - Unplug your hard drive and plug it in again. Then do
> Code:
> --------------------
> journalctl -n 20
> --------------------
> and post the result here.

Try “smartctl -a /dev/sdb” and post it here, too.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

If a file system is written direct to a device without a partition table the partition tools will not show anything.

Not sure why the OP does not seem to want to have a partition table. The way I read it he was writing a file system direct to a device not having a partition. Even so the device should show up

On 2014-11-30 17:46, gogalthorp wrote:
>
> If a file system is written direct to a device without a partition table
> the partition tools will not show anything.

But file and lsblk would.

> Not sure why the OP does not seem to want to have a partition table.

I rather think that it was destroyed.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Hi robin_listas,

That is definitely true and i do not expect any thing different. I just thought that a screenshot - unlike a “cut and paste” action out of the console - might be less prone to “loss of information”.

In his second post Hermes14 gave us this:

@gogalthorp:

So far i never managed (or better) never tryed to write a filesystem to a device without creating a partition beforehand. How could one do this? I’m just curious because if there is a way to do it, we could ask Hermes14 if he used it.

Best regards

susejunky

Just copy it straight to the device.

Note it won’t actually work since most things expect a partitioned drive. But you can make the copy and it will overwrite anything else on the drive including the MBR and file partition table… It does work in the case of special ISO’s since the iso is actuall aan image of a file system. Make bookable USB’s by using cp to copy the ISO to a device. In that case the iso also has a partition table. Note there is no magic about a partition table it is just a list of start and end sectors for each defined partition stored on the first track of a drive. if you simply do a cp . /dev/sdX the system will happily copy all the files in the current directory direct to the device. Starting with track 0 thus wiping any MBR or partition table there. All the data will be there just not in a format that most things would understand

On 2014-11-30 18:26, susejunky wrote:
>
> Hi robin_listas,
>
> robin_listas;2679847 Wrote:
>> Notice that fdisk and lsblk said there is nothing in that disk, so the
>> partitioner can not say differently. And “file” saw nothing either.
> That is definitely true and i do not expect any thing different. I just
> thought that a screenshot - unlike a “cut and paste” action out of the
> console - might be less prone to “loss of information”.

Good point :slight_smile:

> robin_listas;2679847 Wrote:
>> Seeing as model “trascend” makes me wonder if this is an external disk
>> in a box?
> In his second post Hermes14 gave us this:Hermes14;2679847 Wrote:
>> My external hard drive is a Transcend Storejet 35 ultra

But on another post he said that sdb is not that one. Or so I
understood: «I was looking at mounting my external but then I would have
to create sdb1 which would not help me at all my stuff is in sdb.»

Unclear.

> @gogalthorp:
>
> So far i never managed (or better) never tryed to write a filesystem to
> a device without creating a partition beforehand. How could one do
> this? I’m just curious because if there is a way to do it, we could ask
> Hermes14 if he used it.

Easy:


mkfs.ext4 /dev/sdb   plus options.

You just “forget” to type the number sdb1 or sdb15 and presto, you
format the entire disk… And it works :slight_smile:

But he said that the disk was formatted ntfs, I understand from Windows.
Using no partitions is not a thing Windows does, AFAIK…


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Hi robin_listas, hi gogalthorp,

thank you very much for your reply! I was not aware of this !!!

So i made some tests using a spare USB-stick (/dev/sdc):

  1. cp test.txt /dev/sdc
    Will “destroy” the stick; i.e. YaST Partitioner will say that there is no partition on the stick. When the stick is plugged in the KDE device manager (may be the English term i use here is not correct; in German it’s “Geräteüberwachung”) will not recognise the stick. The stick can’t be mounted from the command line either.
  2. cp test.iso /dev/sdc
    YaST Partitioner will still say that there is no partition on the stick, but when the stick is plugged in the KDE device manager will recognise the stick and i can use dolphin to explore the contents of the stick (=> stick can be mounted).
  3. mkfs.ext4
    YaST Partitioner will still say that there is no partition on the stick, but when the stick is plugged in the KDE device manager will recognise the stick and i can use dolphin to explore and alter the contents of the stick (=> stick can be mounted).

So if Hermes14 did 1. he might not be able to recover any data from his external drive. Correct?

If he did 2. or 3. he should be able to mount the drive and recover the data from the drive.

Best regards

susejunky

On 2014-11-30 20:16, susejunky wrote:
>
> Hi robin_listas, hi gogalthorp,
>
> thank you very much for your reply! I was not aware of this !!!
>
> So i made some tests using a spare USB-stick (/dev/sdc):
>
>
> - cp test.txt /dev/sdc
> Will “destroy” the stick; i.e. YaST Partitioner will say that there is
> no partition on the stick. When the stick is plugged in the KDE device
> manager (may be the English term i use here is not correct; in German
> it’s “Geräteüberwachung”) will not recognise the stick. The stick
> can’t be mounted from the command line either.
> - cp test.iso /dev/sdc
> YaST Partitioner will still say that there is no partition on the
> stick, but when the stick is plugged in the KDE device manager will
> recognise the stick and i can use dolphin to explore the contents of
> the stick (=> stick can be mounted).
> - mkfs.ext4
> YaST Partitioner will still say that there is no partition on the
> stick, but when the stick is plugged in the KDE device manager will
> recognise the stick and i can use dolphin to explore and alter the
> contents of the stick (=> stick can be mounted).
>
>
> So if Hermes14 did 1. he might not be able to recover any data from his
> external drive. Correct?

No; the data can be retrieved with a “copy”. The problem is that the
system doesn’t know the size of the “file”, it would copy the entire
disk. But knowing the size, you can copy it back to a standard file with
“dd”.

You can store a bunch of files, and retrieve them, if you know the
sizes, ordering, and names. Or, you can store a tar archive, which does
include metadata of each file and its position in the archive. Tapes
were made similarly.

Some databases write directly to the disk, not using a filesytem at all.
They just store a single large file per disk or per partition. This
worked faster on some systems.

For instance… years ago, on Linux — actually, on the previous century
—, in order to burn CDs, we used a raw unformatted partition as
temporary space. It was significantly faster, which was important
because failure to feed the CD burner with data as fast as it was needed
would cause it to stop in the middle of the burn, and produce a dish
instead of a CD. There is a name for that type of failure, but I don’t
remember it. Modern burners have protection for it.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Hi robin_listas,

i was aware of the “dd”-solution. But assuming that the partition table of Hermes14 disk got destroyed by accident one needs to assume as well that the disk was not created like a tape. Therefore a single file might be splattered across the whole disk (former partition). So it would not be enough to know the exact size and starting point of a file to retrieve it correctly.

You are right: “dd” could be used. But in this case here i consider it to be a more theoretical solution.

Best regards

susejunky

On 2014-12-01 00:06, susejunky wrote:
>
> Hi robin_listas,
>
> i was aware of the “dd”-solution. But assuming that the partition table
> of Hermes14 disk got destroyed by accident one needs to assume as well
> that the disk was not created like a tape. Therefore a single file might
> be splattered across the whole disk (former partition). So it would not
> be enough to know the exact size and starting point of a file to
> retrieve it correctly.

No, the file would never be “splattered” but contiguous. Just knowing
the size is enough, as the starting point is record number zero. To do
it differently you need to do it on purpose. Not easy even with ‘dd’.

You can try it.

Suppose you have “somefile”, of exactly 123456 bytes in length. Then do,
on a device that you can delete entirely for the test:


cp somefile /dev/sdX

this destroys the partition table, replaced with the start of the file.


dd if=/dev/sdX of=somefile_copy bs=123456 count=1

And that recovers an exact copy of the file.

> You are right: “dd” could be used. But in this case here i consider it
> to be a more theoretical solution.

They were just samples of intentional usage of raw devices. :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)