LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Identifying device in dd Command (https://www.linuxquestions.org/questions/linux-newbie-8/identifying-device-in-dd-command-924368/)

LindaVermeulen 01-18-2012 01:51 AM

Identifying device in dd Command
 
Hi

has plugged in my cf card into my USB Card Reader. Before I format or partition anything I want to make sure that I am typing in for the correct device as I do not want to accidentally format my hard drive

is there a command which you can type in that will show your devices as I don't know if it is sda, sdb etc. It is a CF4G card.

Thank you so much

fukawi1 01-18-2012 02:07 AM

Code:

fdisk -l
Code:

cat /proc/partitions
Momentarily after inserting the drive/disk/card/etc, dmesg will also show it.
Code:

~ $ dmesg | tail
[1250091.630855] sd 10:0:0:0: Attached scsi generic sg3 type 0
[1250091.631646] sd 10:0:0:0: [sdc] 15695871 512-byte logical blocks: (8.03 GB/7.48 GiB)
[1250091.632364] sd 10:0:0:0: [sdc] Write Protect is off
[1250091.632369] sd 10:0:0:0: [sdc] Mode Sense: 45 00 00 08
[1250091.632373] sd 10:0:0:0: [sdc] Assuming drive cache: write through
[1250091.634639] sd 10:0:0:0: [sdc] Assuming drive cache: write through
[1250091.634646]  sdc: sdc1
[1250091.637892] sd 10:0:0:0: [sdc] Assuming drive cache: write through
[1250091.637899] sd 10:0:0:0: [sdc] Attached SCSI removable disk


LindaVermeulen 01-18-2012 02:37 AM

Hi

Thank you

I did all your steps and got the following:

anesh@Linda-PC:~$ fdisk -1
fdisk: invalid option -- '1'

Usage:
fdisk [options] <disk> change partition table
fdisk [options] -l <disk> list partition table(s)
fdisk -s <partition> give partition size(s) in blocks

Options:
-b <size> sector size (512, 1024, 2048 or 4096)
-c switch off DOS-compatible mode
-h print help
-u <size> give sizes in sectors instead of cylinders
-v print version
-C <number> specify the number of cylinders
-H <number> specify the number of heads
-S <number> specify the number of sectors per track

anesh@Linda-PC:~$ cat /proc/partitions
major minor #blocks name

8 0 976762584 sda
8 1 965472256 sda1
8 2 1 sda2
8 5 11287552 sda5
8 16 3915576 sdb
8 17 31 sdb1
8 18 28 sdb2
8 19 28 sdb3
8 20 28 sdb4
8 21 28 sdb5
8 22 256 sdb6
8 23 256 sdb7
8 24 256 sdb8
8 25 131072 sdb9
8 26 3783584 sdb10
8 27 8 sdb11
anesh@Linda-PC:~$ dsmeg | tail
dsmeg: command not found
anesh@Linda-PC:~$ dmesg | tail
[77159.196872] sd 8:0:0:0: [sdb] Write Protect is off
[77159.196880] sd 8:0:0:0: [sdb] Mode Sense: 03 00 00 00
[77159.196886] sd 8:0:0:0: [sdb] Assuming drive cache: write through
[77159.199373] sd 8:0:0:3: [sde] Attached SCSI removable disk
[77159.200695] sd 8:0:0:2: [sdd] Attached SCSI removable disk
[77159.202800] sd 8:0:0:0: [sdb] Assuming drive cache: write through
[77159.202811] sdb: [mac] sdb1 sdb2 sdb3 sdb4 sdb5 sdb6 sdb7 sdb8 sdb9 sdb10 sdb11
[77159.207877] sd 8:0:0:0: [sdb] Assuming drive cache: write through
[77159.207881] sd 8:0:0:0: [sdb] Attached SCSI removable disk
[77161.882191] hfs: write access to a journaled filesystem is not supported, use the force option at your own risk, mounting read-only.
anesh@Linda-PC:~$


Thus meaning that my cf card is sdb, right?

fukawi1 01-18-2012 03:06 AM

firstly, please use code tags when posting console output.
secondly, its fdisk -[lower case "L"], and you may have to run it as root.
thirdly, yes it would appear sdb is the CF card, although, the partitions shown on that device seems very odd to me. I have no explanation as to why it would be configured with so many small partitions..


All times are GMT -5. The time now is 12:18 PM.