You are not logged in.

#1 2014-07-12 15:06:52

ysetdng
Member
Registered: 2014-05-02
Posts: 40

[SOLVED] Weird behaviour after formatting USB installation media

Hi, I have noticed this weird behaviour with USB drives I used to install Arch linux with.  I format them using fdisk and mkntfs but after replugging them in, the udevil daemon mounts them again as ARCH_2013...[something] and even the directory tree exists!  This happens also when I use mkntfs without the -f flag (initializing with zeros).  I also checked the other files in /dev/sd* in order to make sure that my drive does not appear twice, but there is only sda (my HD) and sdd (or sometimes sdb, sdc,...) which must be the USB drive, also according to dmesg.

Any ideas?

EDIT: I wrote something about not seeing any files when manually mounting but that was my bad, I only tried mounting /dev/sdb1 but mounting /dev/sdb brought me the same files as devmon showed.

Last edited by ysetdng (2014-07-12 22:36:46)

Offline

#2 2014-07-12 15:12:34

Lukan27
Member
From: Denmark
Registered: 2012-12-02
Posts: 6

Re: [SOLVED] Weird behaviour after formatting USB installation media

Are you sure you set fdisk to write the changes you want? smile


"Everyone thinks of changing the world, but no one thinks of changing himself." - Leo Tolstoy

Offline

#3 2014-07-12 15:14:00

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,698
Website

Re: [SOLVED] Weird behaviour after formatting USB installation media

ysetdng wrote:

sdd (or sometimes sdb, sdc,...)

It should not be changing like that.  If it is, and given that you describe using different methods to mount it, I suspect that it was mounted multiple times without being unmounted.

I don't know exactly how it all works, but I have seen related symptoms under similar conditions where I removed a usb without unmounting it.  Check the output of `mount` and/or `lsblk` and unmount anything that is not your hard drive - then perhaps reboot for good measure.  I suspect it should not persist after that.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#4 2014-07-12 15:16:51

ysetdng
Member
Registered: 2014-05-02
Posts: 40

Re: [SOLVED] Weird behaviour after formatting USB installation media

Lukan27 wrote:

Are you sure you set fdisk to write the changes you want?

Yeah, I exited fdisk with 'w':

Created a new partition 1 of type 'Linux' and of size 7.3 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

Last edited by ysetdng (2014-07-12 15:20:01)

Offline

#5 2014-07-12 15:30:19

ysetdng
Member
Registered: 2014-05-02
Posts: 40

Re: [SOLVED] Weird behaviour after formatting USB installation media

Trilby wrote:

It should not be changing like that.  If it is, and given that you describe using different methods to mount it, I suspect that it was mounted multiple times without being unmounted.

I don't know why it changed so weird but I rebooted shortly before and now it stays sdb anyway.

Trilby wrote:

Check the output of `mount` and/or `lsblk` and unmount anything that is not your hard drive - then perhaps reboot for good measure.  I suspect it should not persist after that.

Thanks for the suggestion!  mount and lsblk show nothing special though.  But I realized I did the manually mounting slightly wrong, I only mounted /dev/sdb1 and that seemed to be empty but mounting /dev/sdb brought me the same files from the Arch ISO than the devmon daemon, so it has nothing to do with devmon.

Offline

#6 2014-07-12 18:20:43

rgb-one
Member
Registered: 2013-09-15
Posts: 19

Re: [SOLVED] Weird behaviour after formatting USB installation media

I am assuming you used dd to write the image to the disk. You can use it to remove the contents of the disk as well.

You should make use of the arch wiki, it is quite helpful.

https://wiki.archlinux.org/index.php/US … tion_Media

You can use this to zero out the entire device:

# dd if=/dev/zero of=/dev/sdx bs=8M  // x is the letter assigned to the usb drive. Be careful, The dd command is destructive. 

It may take a while to zero out the entire disk, depending on the size. After that use fdisk/cfdisk or gdisk/cgdisk to create the partition table and partition.

To create the filesystem type, this one, ext4:

# mkfs.ext4 /dev/sdx // or create a vfat

then create the label:

# e2label /dev/sdx1 USB_STICK_LABEL

Use my suggestion as a last resort. Read the wiki, most of what I have said is in there anyway.

Last edited by rgb-one (2014-07-12 18:21:18)

Offline

#7 2014-07-12 22:36:27

ysetdng
Member
Registered: 2014-05-02
Posts: 40

Re: [SOLVED] Weird behaviour after formatting USB installation media

Thanks a lot rgb-one!

Offline

Board footer

Powered by FluxBB