Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #207735 > unrolled thread

What's the device name of my microSD card?

Started byErik Josefsson <erik.hjalmar.josefsson@gmail.com>
First post2019-04-21 20:10 +0200
Last post2019-04-21 21:20 +0200
Articles 14 — 7 participants

Back to article view | Back to linux.debian.user


Contents

  What's the device name of my microSD card? Erik Josefsson <erik.hjalmar.josefsson@gmail.com> - 2019-04-21 20:10 +0200
    Fwd: What's the device name of my microSD card? Patrick Wiseman <pwiseman@gmail.com> - 2019-04-21 20:20 +0200
    Re: What's the device name of my microSD card? Paul Sutton <zleap@disroot.org> - 2019-04-21 20:20 +0200
      Re: What's the device name of my microSD card? Patrick Wiseman <pwiseman@gmail.com> - 2019-04-21 20:40 +0200
        Re: What's the device name of my microSD card? Patrick Wiseman <pwiseman@gmail.com> - 2019-04-21 21:00 +0200
      Re: What's the device name of my microSD card? Erik Josefsson <erik.hjalmar.josefsson@gmail.com> - 2019-04-21 20:40 +0200
        Re: What's the device name of my microSD card? David Wright <deblis@lionunicorn.co.uk> - 2019-04-21 22:10 +0200
          Re: What's the device name of my microSD card? Erik Josefsson <erik.hjalmar.josefsson@gmail.com> - 2019-04-21 23:10 +0200
            Re: What's the device name of my microSD card? David Wright <deblis@lionunicorn.co.uk> - 2019-04-22 03:10 +0200
            Re: What's the device name of my microSD card? Pascal Hambourg <pascal@plouf.fr.eu.org> - 2019-04-22 09:40 +0200
      Re: What's the device name of my microSD card? Jonas Smedegaard <jonas@jones.dk> - 2019-04-21 21:30 +0200
    Re: What's the device name of my microSD card? Reco <recoverym4n@enotuniq.net> - 2019-04-21 20:30 +0200
      Re: What's the device name of my microSD card? Reco <recoverym4n@enotuniq.net> - 2019-04-21 21:20 +0200
      Re: What's the device name of my microSD card? Jonas Smedegaard <jonas@jones.dk> - 2019-04-21 21:20 +0200

#207735 — What's the device name of my microSD card?

FromErik Josefsson <erik.hjalmar.josefsson@gmail.com>
Date2019-04-21 20:10 +0200
SubjectWhat's the device name of my microSD card?
Message-ID<xPp4B-59j-7@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

I have just assembled a [Teres machine] to learn how to set it up from 
the instructions on http://box.redpill.dk/ mentioned before on this list.

I run into my ignorance already at instruction 2: "Locate device name of 
your microSD card".

It turns out when I use completion with ls /dev/disk/by-id/ that my new 
USB microSD card reader says that my micro SD card has two names:

    usb-Generic_STORAGE_DEVICE_000000001532-0:0
    usb-Generic_STORAGE_DEVICE_000000001532-0:0-part1

This ambiguity becomes problematic when I try instruction 4) "Decompress 
and copy image onto card" with "Fast method" b):

    sudo sh -c 'zcat core-lime2-1.0b17.img.gz > /dev/disk/by-id/my-sd-card'

I guess that the placeholder "my-sd-card" is neither of the two names above.

Basically: How do I find out the device name of my microSD card?

Best regards.

//Erik

[Teres machine] 
https://www.olimex.com/Products/DIY-Laptop/KITS/TERES-A64-BLACK/

[toc] | [next] | [standalone]


#207736

FromPatrick Wiseman <pwiseman@gmail.com>
Date2019-04-21 20:20 +0200
Message-ID<xPpei-5cT-13@gated-at.bofh.it>
In reply to#207735

[Multipart message — attachments visible in raw view] — view raw

Sorry - relied to OP not to list.

---------- Forwarded message ---------
From: Patrick Wiseman <pwiseman@gmail.com>
Date: Sun, Apr 21, 2019 at 2:13 PM
Subject: Re: What's the device name of my microSD card?
To: Erik Josefsson <erik.hjalmar.josefsson@gmail.com>


On Sun, Apr 21, 2019 at 2:03 PM Erik Josefsson <
erik.hjalmar.josefsson@gmail.com> wrote:

> I have just assembled a [Teres machine] to learn how to set it up from the
> instructions on http://box.redpill.dk/ mentioned before on this list.
>
> I run into my ignorance already at instruction 2: "Locate device name of
> your microSD card".
>
> It turns out when I use completion with ls /dev/disk/by-id/ that my new
> USB microSD card reader says that my micro SD card has two names:
>
> usb-Generic_STORAGE_DEVICE_000000001532-0:0
> usb-Generic_STORAGE_DEVICE_000000001532-0:0-part1
>
> This ambiguity becomes problematic when I try instruction 4) "Decompress
> and copy image onto card" with "Fast method" b):
>
> sudo sh -c 'zcat core-lime2-1.0b17.img.gz > /dev/disk/by-id/my-sd-card'
>
> I guess that the placeholder "my-sd-card" is neither of the two names
> above.
>
> Basically: How do I find out the device name of my microSD card?
>
>
>From the command line, 'df' returns free disk space and lists all mounted
devices by device name. (One of probably many ways to do it!)

Patrick

[toc] | [prev] | [next] | [standalone]


#207737

FromPaul Sutton <zleap@disroot.org>
Date2019-04-21 20:20 +0200
Message-ID<xPpei-5cT-17@gated-at.bofh.it>
In reply to#207735
On 21/04/2019 19:02, Erik Josefsson wrote:
>
> I have just assembled a [Teres machine] to learn how to set it up from
> the instructions on http://box.redpill.dk/ mentioned before on this list.
>
> I run into my ignorance already at instruction 2: "Locate device name
> of your microSD card".
>
> It turns out when I use completion with ls /dev/disk/by-id/ that my
> new USB microSD card reader says that my micro SD card has two names:
>
>     usb-Generic_STORAGE_DEVICE_000000001532-0:0
>     usb-Generic_STORAGE_DEVICE_000000001532-0:0-part1
>
> This ambiguity becomes problematic when I try instruction 4)
> "Decompress and copy image onto card" with "Fast method" b):
>
>     sudo sh -c 'zcat core-lime2-1.0b17.img.gz >
>     /dev/disk/by-id/my-sd-card'
>
> I guess that the placeholder "my-sd-card" is neither of the two names
> above.
>
> Basically: How do I find out the device name of my microSD card?
>
> Best regards.
>
> //Erik
>
> [Teres machine]
> https://www.olimex.com/Products/DIY-Laptop/KITS/TERES-A64-BLACK/

Not to sure if this helps.  if you run lsblk it will list devices
connected to the system,  just plugged in a usb flash disk and it showed
up as

sdg      8:96   1   3.8G  0 disk
├─sdg1   8:97   1   640M  0 part /media/psutton/Rescatux0.51b3
└─sdg2   8:98   1   704K  0 part

from the man page (man lsblk)

NAME
       lsblk - list block devices

Worth a try

if you run

lsblk | tee lsblkoutput.txt

Output will be directed to the console AND the file lsblkoutput.txt.

  

Hope this helps

Paul

-- 
Paul Sutton
http://www.zleap.net
https://www.linkedin.com/in/zleap/
gnupg : 7D6D B682 F351 8D08 1893  1E16 F086 5537 D066 302D

[toc] | [prev] | [next] | [standalone]


#207739

FromPatrick Wiseman <pwiseman@gmail.com>
Date2019-04-21 20:40 +0200
Message-ID<xPpxE-5jx-5@gated-at.bofh.it>
In reply to#207737

[Multipart message — attachments visible in raw view] — view raw

On Sun, Apr 21, 2019 at 2:30 PM Erik Josefsson <
erik.hjalmar.josefsson@gmail.com> wrote:

> On 4/21/19 6:14 PM, Patrick Wiseman wrote:
>
> From the command line, 'df' returns free disk space and lists all mounted
> devices by device name. (One of probably many ways to do it!)
>
>
> On 4/21/19 6:17 PM, Paul Sutton wrote:
>
> if you run lsblk it will list devices connected to the system
>
>
> Here's the output of both commands, not sure I can figure out which one(s)
> is(are) my usb-Generic_STORAGE_DEVICE (i.e. a microSD put into a
> USB-thingie):
>
> debian@hamlet:~$ df
> Filesystem     1K-blocks     Used Available Use% Mounted on
> udev              961108        0    961108   0% /dev
> tmpfs             201708     3260    198448   2% /run
> /dev/mmcblk0p2  61214500 11372112  47335168  20% /
> tmpfs            1008520    50808    957712   6% /dev/shm
> tmpfs               5120        0      5120   0% /run/lock
> tmpfs            1008520        0   1008520   0% /sys/fs/cgroup
> tmpfs            1008520        8   1008512   1% /tmp
> tmpfs            1008520        0   1008520   0% /var/tmp
> /dev/mmcblk0p1    202277    48430    143403  26% /boot
> tmpfs             201704       24    201680   1% /run/user/1000
>
Its absence from this list suggests to me that it's not mounted. You have a
root (/) device and a /boot device mounted, but no others.

Patrick

[toc] | [prev] | [next] | [standalone]


#207742

FromPatrick Wiseman <pwiseman@gmail.com>
Date2019-04-21 21:00 +0200
Message-ID<xPpR0-5qb-13@gated-at.bofh.it>
In reply to#207739

[Multipart message — attachments visible in raw view] — view raw

On Sun, Apr 21, 2019 at 2:38 PM Patrick Wiseman <pwiseman@gmail.com> wrote:

> On Sun, Apr 21, 2019 at 2:30 PM Erik Josefsson <
> erik.hjalmar.josefsson@gmail.com> wrote:
>
>> On 4/21/19 6:14 PM, Patrick Wiseman wrote:
>>
>> From the command line, 'df' returns free disk space and lists all mounted
>> devices by device name. (One of probably many ways to do it!)
>>
>>
>> On 4/21/19 6:17 PM, Paul Sutton wrote:
>>
>> if you run lsblk it will list devices connected to the system
>>
>>
>> Here's the output of both commands, not sure I can figure out which
>> one(s) is(are) my usb-Generic_STORAGE_DEVICE (i.e. a microSD put into a
>> USB-thingie):
>>
>> debian@hamlet:~$ df
>> Filesystem     1K-blocks     Used Available Use% Mounted on
>> udev              961108        0    961108   0% /dev
>> tmpfs             201708     3260    198448   2% /run
>> /dev/mmcblk0p2  61214500 11372112  47335168  20% /
>> tmpfs            1008520    50808    957712   6% /dev/shm
>> tmpfs               5120        0      5120   0% /run/lock
>> tmpfs            1008520        0   1008520   0% /sys/fs/cgroup
>> tmpfs            1008520        8   1008512   1% /tmp
>> tmpfs            1008520        0   1008520   0% /var/tmp
>> /dev/mmcblk0p1    202277    48430    143403  26% /boot
>> tmpfs             201704       24    201680   1% /run/user/1000
>>
> Its absence from this list suggests to me that it's not mounted. You have
> a root (/) device and a /boot device mounted, but no others.
>

I think, by the way, that you'll _want_ it unmounted when you copy the
image.

Patrick

[toc] | [prev] | [next] | [standalone]


#207741

FromErik Josefsson <erik.hjalmar.josefsson@gmail.com>
Date2019-04-21 20:40 +0200
Message-ID<xPpxE-5jx-7@gated-at.bofh.it>
In reply to#207737

[Multipart message — attachments visible in raw view] — view raw

On 4/21/19 6:14 PM, Patrick Wiseman wrote:
> From the command line, 'df' returns free disk space and lists all 
> mounted devices by device name. (One of probably many ways to do it!)

On 4/21/19 6:17 PM, Paul Sutton wrote:
> if you run lsblk it will list devices connected to the system

Here's the output of both commands, not sure I can figure out which 
one(s) is(are) my usb-Generic_STORAGE_DEVICE (i.e. a microSD put into a 
USB-thingie):

debian@hamlet:~$ df
Filesystem     1K-blocks     Used Available Use% Mounted on
udev              961108        0    961108   0% /dev
tmpfs             201708     3260    198448   2% /run
/dev/mmcblk0p2  61214500 11372112  47335168  20% /
tmpfs            1008520    50808    957712   6% /dev/shm
tmpfs               5120        0      5120   0% /run/lock
tmpfs            1008520        0   1008520   0% /sys/fs/cgroup
tmpfs            1008520        8   1008512   1% /tmp
tmpfs            1008520        0   1008520   0% /var/tmp
/dev/mmcblk0p1    202277    48430    143403  26% /boot
tmpfs             201704       24    201680   1% /run/user/1000

debian@hamlet:~$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda            8:0    1 29.7G  0 disk
└─sda1         8:1    1 29.7G  0 part
mmcblk0      179:0    0 59.5G  0 disk
├─mmcblk0p1  179:1    0  204M  0 part /boot
└─mmcblk0p2  179:2    0 59.3G  0 part /
mmcblk2      179:256  0 13.8G  0 disk
├─mmcblk2p1  179:257  0   50M  0 part
└─mmcblk2p2  179:258  0 13.7G  0 part
mmcblk2boot0 179:512  0   16M  1 disk
mmcblk2boot1 179:768  0   16M  1 disk


When I'm at it, here's the full ls completion from ls -al /dev/disk/by-id

debian@hamlet:~$ ls -al /dev/disk/by-id/
mmc-R1J56L_0x7da477d7
mmc-R1J56L_0x7da477d7-part1
mmc-R1J56L_0x7da477d7-part2
mmc-SN64G_0x3376cd3a
mmc-SN64G_0x3376cd3a-part1
mmc-SN64G_0x3376cd3a-part2
usb-Generic_STORAGE_DEVICE_000000001532-0:0
usb-Generic_STORAGE_DEVICE_000000001532-0:0-part1


It's the usb-Generic storage I want to copy the gz image to.

Thanks for your help!

//Erik

[toc] | [prev] | [next] | [standalone]


#207747

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2019-04-21 22:10 +0200
Message-ID<xPqWJ-6iU-3@gated-at.bofh.it>
In reply to#207741
On Sun 21 Apr 2019 at 18:30:28 (+0000), Erik Josefsson wrote:
> On 4/21/19 6:14 PM, Patrick Wiseman wrote:
> > From the command line, 'df' returns free disk space and lists all
> > mounted devices by device name. (One of probably many ways to do
> > it!)
> 
> On 4/21/19 6:17 PM, Paul Sutton wrote:
> > if you run lsblk it will list devices connected to the system
> 
> Here's the output of both commands, not sure I can figure out which
> one(s) is(are) my usb-Generic_STORAGE_DEVICE (i.e. a microSD put into
> a USB-thingie):
> 
> debian@hamlet:~$ df
> Filesystem     1K-blocks     Used Available Use% Mounted on
> udev              961108        0    961108   0% /dev
> tmpfs             201708     3260    198448   2% /run
> /dev/mmcblk0p2  61214500 11372112  47335168  20% /
> tmpfs            1008520    50808    957712   6% /dev/shm
> tmpfs               5120        0      5120   0% /run/lock
> tmpfs            1008520        0   1008520   0% /sys/fs/cgroup
> tmpfs            1008520        8   1008512   1% /tmp
> tmpfs            1008520        0   1008520   0% /var/tmp
> /dev/mmcblk0p1    202277    48430    143403  26% /boot
> tmpfs             201704       24    201680   1% /run/user/1000
> 
> debian@hamlet:~$ lsblk
> NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
> sda            8:0    1 29.7G  0 disk
> └─sda1         8:1    1 29.7G  0 part
> mmcblk0      179:0    0 59.5G  0 disk
> ├─mmcblk0p1  179:1    0  204M  0 part /boot
> └─mmcblk0p2  179:2    0 59.3G  0 part /
> mmcblk2      179:256  0 13.8G  0 disk
> ├─mmcblk2p1  179:257  0   50M  0 part
> └─mmcblk2p2  179:258  0 13.7G  0 part
> mmcblk2boot0 179:512  0   16M  1 disk
> mmcblk2boot1 179:768  0   16M  1 disk
> 
> 
> When I'm at it, here's the full ls completion from ls -al /dev/disk/by-id
> 
> debian@hamlet:~$ ls -al /dev/disk/by-id/
> mmc-R1J56L_0x7da477d7
> mmc-R1J56L_0x7da477d7-part1
> mmc-R1J56L_0x7da477d7-part2
> mmc-SN64G_0x3376cd3a
> mmc-SN64G_0x3376cd3a-part1
> mmc-SN64G_0x3376cd3a-part2
> usb-Generic_STORAGE_DEVICE_000000001532-0:0
> usb-Generic_STORAGE_DEVICE_000000001532-0:0-part1

I don't understand this output from   ls -al   as the -l switch should
show a lot more information, viz:

lrwxrwxrwx 1 root root 13 Apr 21 14:52 mmc-SD01G_0x00c2ed5b -> ../../mmcblk0
lrwxrwxrwx 1 root root 15 Apr 21 14:52 mmc-SD01G_0x00c2ed5b-part1 -> ../../mmcblk0p1

which is showing my SD card out of a digital camera.

The first line is the card itself, the second is a single partition
containing a FAT16 filesystem.

The names you're quoting should be symbolic links created by udev, and
they should point to the /dev names assigned by the kernel.

> It's the usb-Generic storage I want to copy the gz image to.

Your instructions would appear to write to the whole device, which is
quite normal. The image itself will contain any partitioning required.
In my case, that would be to /dev/mmcblk0. It looks like you have more
choice, so take care.

Cheers,
David.

[toc] | [prev] | [next] | [standalone]


#207749

FromErik Josefsson <erik.hjalmar.josefsson@gmail.com>
Date2019-04-21 23:10 +0200
Message-ID<xPrSN-6RP-3@gated-at.bofh.it>
In reply to#207747
On 4/21/19 8:05 PM, David Wright wrote:
> On Sun 21 Apr 2019 at 18:30:28 (+0000), Erik Josefsson wrote:
>> On 4/21/19 6:14 PM, Patrick Wiseman wrote:
>>>  From the command line, 'df' returns free disk space and lists all
>>> mounted devices by device name. (One of probably many ways to do
>>> it!)
>> On 4/21/19 6:17 PM, Paul Sutton wrote:
>>> if you run lsblk it will list devices connected to the system
>> Here's the output of both commands, not sure I can figure out which
>> one(s) is(are) my usb-Generic_STORAGE_DEVICE (i.e. a microSD put into
>> a USB-thingie):
>>
>> debian@hamlet:~$ df
>> Filesystem     1K-blocks     Used Available Use% Mounted on
>> udev              961108        0    961108   0% /dev
>> tmpfs             201708     3260    198448   2% /run
>> /dev/mmcblk0p2  61214500 11372112  47335168  20% /
>> tmpfs            1008520    50808    957712   6% /dev/shm
>> tmpfs               5120        0      5120   0% /run/lock
>> tmpfs            1008520        0   1008520   0% /sys/fs/cgroup
>> tmpfs            1008520        8   1008512   1% /tmp
>> tmpfs            1008520        0   1008520   0% /var/tmp
>> /dev/mmcblk0p1    202277    48430    143403  26% /boot
>> tmpfs             201704       24    201680   1% /run/user/1000
>>
>> debian@hamlet:~$ lsblk
>> NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
>> sda            8:0    1 29.7G  0 disk
>> └─sda1         8:1    1 29.7G  0 part
>> mmcblk0      179:0    0 59.5G  0 disk
>> ├─mmcblk0p1  179:1    0  204M  0 part /boot
>> └─mmcblk0p2  179:2    0 59.3G  0 part /
>> mmcblk2      179:256  0 13.8G  0 disk
>> ├─mmcblk2p1  179:257  0   50M  0 part
>> └─mmcblk2p2  179:258  0 13.7G  0 part
>> mmcblk2boot0 179:512  0   16M  1 disk
>> mmcblk2boot1 179:768  0   16M  1 disk
>>
>>
>> When I'm at it, here's the full ls completion from ls -al /dev/disk/by-id
>>
>> debian@hamlet:~$ ls -al /dev/disk/by-id/
>> mmc-R1J56L_0x7da477d7
>> mmc-R1J56L_0x7da477d7-part1
>> mmc-R1J56L_0x7da477d7-part2
>> mmc-SN64G_0x3376cd3a
>> mmc-SN64G_0x3376cd3a-part1
>> mmc-SN64G_0x3376cd3a-part2
>> usb-Generic_STORAGE_DEVICE_000000001532-0:0
>> usb-Generic_STORAGE_DEVICE_000000001532-0:0-part1
> I don't understand this output from   ls -al   as the -l switch should
> show a lot more information, viz:

Indeed, I only pasted completion, not the output. Apologies.

Here's the output:

debdebian@hamlet:/dev/disk/by-id$ ls -al
total 0
drwxr-xr-x 2 root root 200 Apr 21 17:22 .
drwxr-xr-x 7 root root 140 Apr 21 17:22 ..
lrwxrwxrwx 1 root root  13 Apr 21 17:22 mmc-R1J56L_0x7da477d7 -> 
../../mmcblk2
lrwxrwxrwx 1 root root  15 Apr 21 17:22 mmc-R1J56L_0x7da477d7-part1 -> 
../../mmcblk2p1
lrwxrwxrwx 1 root root  15 Apr 21 17:22 mmc-R1J56L_0x7da477d7-part2 -> 
../../mmcblk2p2
lrwxrwxrwx 1 root root  13 Apr 21 17:22 mmc-SN64G_0x3376cd3a -> 
../../mmcblk0
lrwxrwxrwx 1 root root  15 Apr 21 17:22 mmc-SN64G_0x3376cd3a-part1 -> 
../../mmcblk0p1
lrwxrwxrwx 1 root root  15 Apr 21 17:22 mmc-SN64G_0x3376cd3a-part2 -> 
../../mmcblk0p2
lrwxrwxrwx 1 root root   9 Apr 21 17:22 
usb-Generic_STORAGE_DEVICE_000000001532-0:0 -> ../../sda
lrwxrwxrwx 1 root root  10 Apr 21 17:22 
usb-Generic_STORAGE_DEVICE_000000001532-0:0-part1 -> ../../sda1

>
> lrwxrwxrwx 1 root root 13 Apr 21 14:52 mmc-SD01G_0x00c2ed5b -> ../../mmcblk0
> lrwxrwxrwx 1 root root 15 Apr 21 14:52 mmc-SD01G_0x00c2ed5b-part1 -> ../../mmcblk0p1
>
> which is showing my SD card out of a digital camera.

Yes, looks the same.


>
> The first line is the card itself, the second is a single partition
> containing a FAT16 filesystem.

Thanks for your explanation, it's getting clearer that "disk" (from 
lsblk) is the same as "device name" (as asked for in the instructions) 
and what you call "the card itself".

>
> The names you're quoting should be symbolic links created by udev, and
> they should point to the /dev names assigned by the kernel.
>
>> It's the usb-Generic storage I want to copy the gz image to.
> Your instructions would appear to write to the whole device, which is
> quite normal. The image itself will contain any partitioning required.
> In my case, that would be to /dev/mmcblk0. It looks like you have more
> choice, so take care.


I now think I should copy to /dev/disk/by-id/sda, but I will sleep on it!


>
> Cheers,
> David.

Thank you David.

And thanks to everybody.

//Erik

[toc] | [prev] | [next] | [standalone]


#207753

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2019-04-22 03:10 +0200
Message-ID<xPvD3-Fh-3@gated-at.bofh.it>
In reply to#207749
On Sun 21 Apr 2019 at 21:09:24 (+0000), Erik Josefsson wrote:
> On 4/21/19 8:05 PM, David Wright wrote:
> > On Sun 21 Apr 2019 at 18:30:28 (+0000), Erik Josefsson wrote:
> > > On 4/21/19 6:14 PM, Patrick Wiseman wrote:
> > > >  From the command line, 'df' returns free disk space and lists all
> > > > mounted devices by device name. (One of probably many ways to do
> > > > it!)
> > > On 4/21/19 6:17 PM, Paul Sutton wrote:
> > > > if you run lsblk it will list devices connected to the system
> > > Here's the output of both commands, not sure I can figure out which
> > > one(s) is(are) my usb-Generic_STORAGE_DEVICE (i.e. a microSD put into
> > > a USB-thingie):
> > > 
> > > debian@hamlet:~$ df
> > > Filesystem     1K-blocks     Used Available Use% Mounted on
> > > udev              961108        0    961108   0% /dev
> > > tmpfs             201708     3260    198448   2% /run
> > > /dev/mmcblk0p2  61214500 11372112  47335168  20% /
> > > tmpfs            1008520    50808    957712   6% /dev/shm
> > > tmpfs               5120        0      5120   0% /run/lock
> > > tmpfs            1008520        0   1008520   0% /sys/fs/cgroup
> > > tmpfs            1008520        8   1008512   1% /tmp
> > > tmpfs            1008520        0   1008520   0% /var/tmp
> > > /dev/mmcblk0p1    202277    48430    143403  26% /boot
> > > tmpfs             201704       24    201680   1% /run/user/1000
> > > 
> > > debian@hamlet:~$ lsblk
> > > NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
> > > sda            8:0    1 29.7G  0 disk
> > > └─sda1         8:1    1 29.7G  0 part
> > > mmcblk0      179:0    0 59.5G  0 disk
> > > ├─mmcblk0p1  179:1    0  204M  0 part /boot
> > > └─mmcblk0p2  179:2    0 59.3G  0 part /
> > > mmcblk2      179:256  0 13.8G  0 disk
> > > ├─mmcblk2p1  179:257  0   50M  0 part
> > > └─mmcblk2p2  179:258  0 13.7G  0 part
> > > mmcblk2boot0 179:512  0   16M  1 disk
> > > mmcblk2boot1 179:768  0   16M  1 disk
> > > 
> > > 
> > > When I'm at it, here's the full ls completion from ls -al /dev/disk/by-id
> > > 
> > > debian@hamlet:~$ ls -al /dev/disk/by-id/
> > > mmc-R1J56L_0x7da477d7
> > > mmc-R1J56L_0x7da477d7-part1
> > > mmc-R1J56L_0x7da477d7-part2
> > > mmc-SN64G_0x3376cd3a
> > > mmc-SN64G_0x3376cd3a-part1
> > > mmc-SN64G_0x3376cd3a-part2
> > > usb-Generic_STORAGE_DEVICE_000000001532-0:0
> > > usb-Generic_STORAGE_DEVICE_000000001532-0:0-part1
> > I don't understand this output from   ls -al   as the -l switch should
> > show a lot more information, viz:
> 
> Indeed, I only pasted completion, not the output. Apologies.
> 
> Here's the output:
> 
> debdebian@hamlet:/dev/disk/by-id$ ls -al
> total 0
> drwxr-xr-x 2 root root 200 Apr 21 17:22 .
> drwxr-xr-x 7 root root 140 Apr 21 17:22 ..
> lrwxrwxrwx 1 root root  13 Apr 21 17:22 mmc-R1J56L_0x7da477d7 ->
> ../../mmcblk2
> lrwxrwxrwx 1 root root  15 Apr 21 17:22 mmc-R1J56L_0x7da477d7-part1 ->
> ../../mmcblk2p1
> lrwxrwxrwx 1 root root  15 Apr 21 17:22 mmc-R1J56L_0x7da477d7-part2 ->
> ../../mmcblk2p2
> lrwxrwxrwx 1 root root  13 Apr 21 17:22 mmc-SN64G_0x3376cd3a ->
> ../../mmcblk0
> lrwxrwxrwx 1 root root  15 Apr 21 17:22 mmc-SN64G_0x3376cd3a-part1 ->
> ../../mmcblk0p1
> lrwxrwxrwx 1 root root  15 Apr 21 17:22 mmc-SN64G_0x3376cd3a-part2 ->
> ../../mmcblk0p2
> lrwxrwxrwx 1 root root   9 Apr 21 17:22
> usb-Generic_STORAGE_DEVICE_000000001532-0:0 -> ../../sda
> lrwxrwxrwx 1 root root  10 Apr 21 17:22
> usb-Generic_STORAGE_DEVICE_000000001532-0:0-part1 -> ../../sda1
> 
> > 
> > lrwxrwxrwx 1 root root 13 Apr 21 14:52 mmc-SD01G_0x00c2ed5b -> ../../mmcblk0
> > lrwxrwxrwx 1 root root 15 Apr 21 14:52 mmc-SD01G_0x00c2ed5b-part1 -> ../../mmcblk0p1
> > 
> > which is showing my SD card out of a digital camera.
> 
> Yes, looks the same.

Yes, my system is probably more typical, with the system on spinning
rust on sda and the camera SD card plugged into a slot giving it the
mmcblk… device name, whereas your USB card reader is giving the card
a sd… name. I'm not familiar with the mmc-… devices that your system
resides on (or the TERES laptop).

> > The first line is the card itself, the second is a single partition
> > containing a FAT16 filesystem.
> 
> Thanks for your explanation, it's getting clearer that "disk" (from
> lsblk) is the same as "device name" (as asked for in the instructions)
> and what you call "the card itself".

That's right.

> > The names you're quoting should be symbolic links created by udev, and
> > they should point to the /dev names assigned by the kernel.
> > 
> > > It's the usb-Generic storage I want to copy the gz image to.
> > Your instructions would appear to write to the whole device, which is
> > quite normal. The image itself will contain any partitioning required.
> > In my case, that would be to /dev/mmcblk0. It looks like you have more
> > choice, so take care.
> 
> 
> I now think I should copy to /dev/disk/by-id/sda, but I will sleep on it!

Yes. It looks as if your system booted up with the USB card reader
plugged in, so everything in your listing got the same time: 17:22.

Tomorrow you could boot up the system, and then plug in the card
reader after a minute or two. Two consequences: you'll see the /dev
name appear in kern.log as you plug it in, and your USB links shown
above will have a later timestamp than the system devices. It's
always nice to see corroborating evidence of devices' identities
when about to write to a raw device.

Cheers,
David.

[toc] | [prev] | [next] | [standalone]


#207762

FromPascal Hambourg <pascal@plouf.fr.eu.org>
Date2019-04-22 09:40 +0200
Message-ID<xPBIt-4mQ-13@gated-at.bofh.it>
In reply to#207749
Le 21/04/2019 à 23:09, Erik Josefsson a écrit :
> 
> I now think I should copy to /dev/disk/by-id/sda

That does not exist. The symlink points to /dev/sda.

[toc] | [prev] | [next] | [standalone]


#207746

FromJonas Smedegaard <jonas@jones.dk>
Date2019-04-21 21:30 +0200
Message-ID<xPqk1-5Qh-5@gated-at.bofh.it>
In reply to#207737

[Multipart message — attachments visible in raw view] — view raw

Quoting Paul Sutton (2019-04-21 20:17:16)
> 
> On 21/04/2019 19:02, Erik Josefsson wrote:
> > I run into my ignorance already at instruction 2: "Locate device 
> > name of your microSD card".
> >
> > It turns out when I use completion with ls /dev/disk/by-id/ that my 
> > new USB microSD card reader says that my micro SD card has two 
> > names:
> >
> >     usb-Generic_STORAGE_DEVICE_000000001532-0:0
> >     usb-Generic_STORAGE_DEVICE_000000001532-0:0-part1

The clues missing from that instruction is that you should locate the 
_path_ (not only the name) for the _disk_ (not partitions on it).


> Not to sure if this helps.  if you run lsblk it will list devices 
> connected to the system,  just plugged in a usb flash disk and it 
> showed up as
> 
> sdg      8:96   1   3.8G  0 disk
> ├─sdg1   8:97   1   640M  0 part /media/psutton/Rescatux0.51b3
> └─sdg2   8:98   1   704K  0 part

Yes, I agree lsblk is a good tool here: It a) shows topology by default 
which may intuitively help distinguish a USB stick often with a single 
partition from an internal harddrive with several partitions that would 
be devastating to accidentally overwrite, and b) lists explicitly which 
are disks and which are partitions.

(I only discovered that tool recently)

Thanks, Paul!


 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

[toc] | [prev] | [next] | [standalone]


#207738

FromReco <recoverym4n@enotuniq.net>
Date2019-04-21 20:30 +0200
Message-ID<xPpnX-5gg-3@gated-at.bofh.it>
In reply to#207735
	Hi.

On Sun, Apr 21, 2019 at 06:02:33PM +0000, Erik Josefsson wrote:
> I have just assembled a [Teres machine] to learn how to set it up from the instructions on http://box.redpill.dk/ mentioned before on this list.
> 
> I run into my ignorance already at instruction 2: "Locate device name of your microSD card".
> 
> It turns out when I use completion with ls /dev/disk/by-id/ that my new USB microSD card reader says that my micro SD card has two names:
> 
>    usb-Generic_STORAGE_DEVICE_000000001532-0:0

It has one name. This one, to be exact.

>    usb-Generic_STORAGE_DEVICE_000000001532-0:0-part1

And this is the first partition of said device.


> This ambiguity becomes problematic when I try instruction 4) "Decompress and copy image onto card" with "Fast method" b):
> 
>    sudo sh -c 'zcat core-lime2-1.0b17.img.gz > /dev/disk/by-id/my-sd-card'

Ugh. Why run zcat as root if you can avoid it:

zcat core-lime2-1.0b17.img.gz | sudo tee \
/dev/disk/by-id/usb-Generic_STORAGE_DEVICE_000000001532-0\:0 > /dev/null

Reco

[toc] | [prev] | [next] | [standalone]


#207743

FromReco <recoverym4n@enotuniq.net>
Date2019-04-21 21:20 +0200
Message-ID<xPqam-5MV-5@gated-at.bofh.it>
In reply to#207738
	Hi.

On Sun, Apr 21, 2019 at 09:14:02PM +0200, Jonas Smedegaard wrote:
> ...but the ideal for me would be a command considered safe to call as 
> root which did _not_ involve piping tricks, to limit the risk of 
> confusion (I still remember myself in my early days of linux typing ">" 
> instead of "<" and accidentally wiping a file I wanted to read).
> 
> (but before anyone suggests it: No, "dd" is the wrong tool here!)

Sure. It's oldschool, but it works.

echo 'ACTION=="add", ENV{ID_BUS}=="usb", KERNEL=="sd*", GROUP="floppy"'
\ >  /etc/udev/rules.d/z_local.rules

useradd  ... floppy

Reco

[toc] | [prev] | [next] | [standalone]


#207744

FromJonas Smedegaard <jonas@jones.dk>
Date2019-04-21 21:20 +0200
Message-ID<xPqam-5MV-3@gated-at.bofh.it>
In reply to#207738

[Multipart message — attachments visible in raw view] — view raw

Quoting Reco (2019-04-21 20:29:09)
>         Hi.
> 
> On Sun, Apr 21, 2019 at 06:02:33PM +0000, Erik Josefsson wrote:
> > I have just assembled a [Teres machine] to learn how to set it up from the instructions on http://box.redpill.dk/ mentioned before on this list.
> > 
> > I run into my ignorance already at instruction 2: "Locate device name of your microSD card".
> > 
> > It turns out when I use completion with ls /dev/disk/by-id/ that my new USB microSD card reader says that my micro SD card has two names:
> > 
> >    usb-Generic_STORAGE_DEVICE_000000001532-0:0
> 
> It has one name. This one, to be exact.
> 
> >    usb-Generic_STORAGE_DEVICE_000000001532-0:0-part1
> 
> And this is the first partition of said device.
> 
> 
> > This ambiguity becomes problematic when I try instruction 4) "Decompress and copy image onto card" with "Fast method" b):
> > 
> >    sudo sh -c 'zcat core-lime2-1.0b17.img.gz > /dev/disk/by-id/my-sd-card'
> 
> Ugh. Why run zcat as root if you can avoid it:
> 
> zcat core-lime2-1.0b17.img.gz | sudo tee \
> /dev/disk/by-id/usb-Generic_STORAGE_DEVICE_000000001532-0\:0 > /dev/null

Interesting - why is zcat more dangerous than tee to run as root?

Using tee and throwing away its very feature (duplicating a pipe) feels 
excessive to me.  For separating root and non-root parts I seem to 
recall that one can use cat.

...but the ideal for me would be a command considered safe to call as 
root which did _not_ involve piping tricks, to limit the risk of 
confusion (I still remember myself in my early days of linux typing ">" 
instead of "<" and accidentally wiping a file I wanted to read).

(but before anyone suggests it: No, "dd" is the wrong tool here!)


 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web