Skip to content

Instantly share code, notes, and snippets.

@dt1973
Created April 16, 2018 10:56
Show Gist options
  • Save dt1973/77eb6512261e580dfc5e220e115ab3f6 to your computer and use it in GitHub Desktop.
Save dt1973/77eb6512261e580dfc5e220e115ab3f6 to your computer and use it in GitHub Desktop.
root@HP:/home/myuser# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 149,1G 0 disk
├─sda1 8:1 0 148,1G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 1022M 0 part [SWAP]
sdb 8:16 1 1,8G 0 disk
└─sdb1 8:17 1 1,8G 0 part /media/myuser/0C2C-FFEF
sr0 11:0 1 1024M 0 rom
root@HP:/home/myuser# dd if=/dev/zero of=/dev/sdb1 bs=4k && sync
dd: error writing '/dev/sdb1': No space left on device
475192+0 records in
475191+0 records out
1946382336 bytes (1,9 GB, 1,8 GiB) copied, 132,904 s, 14,6 MB/s
root@HP:/home/myuser# fdisk /dev/sdb1
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xf94ddf46.
Command (m for help): o
Created a new DOS disklabel with disk identifier 0xdb4e9d46.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-3801527, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-3801527, default 3801527):
Created a new partition 1 of type 'Linux' and of size 1,8 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Invalid argument
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
root@HP:/home/myuser# mkfs.vfat /dev/sdb1
mkfs.fat 3.0.28 (2015-05-16)
mkfs.vfat: /dev/sdb1 contains a mounted filesystem.
root@HP:/home/myuser# eject/dev/sdb1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment