LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-18-2012, 02:51 AM   #1
LindaVermeulen
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Rep: Reputation: Disabled
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
 
Old 01-18-2012, 03:07 AM   #2
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
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
 
Old 01-18-2012, 03:37 AM   #3
LindaVermeulen
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
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?
 
Old 01-18-2012, 04:06 AM   #4
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
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..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Help identifying a USB device Simon_6162 Programming 2 08-11-2011 10:01 AM
command for identifying the environment variable in a binary at the compilation time logeswari.r Linux - Newbie 8 06-15-2011 08:13 PM
What is Command to know the last mounted device. prasanthp Linux - Newbie 1 06-16-2009 03:32 AM
Identifying Block Device Linux_Kidd Linux - General 0 01-04-2007 08:26 PM
GRUB - Device Command? dsbrand Linux - Newbie 1 08-18-2003 02:18 PM


All times are GMT -5. The time now is 06:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration