1

I have a USB drive disk, whose label is 'DATA'. When I plug in the USB disk, Ubuntu will automatically mount it to /media/cjl/DATA.

I partition it with fdisk command, and I don't want to mount it with 'mount' command. So I unplug the USB drive and plug it in again. Then Ubuntu will automatically mount it to /media/cjl/DATA.

Is there anyway to mount it after fdisk which needn't unplug it?

In other words, how to trigger the plug event without actually plugging in the USB drive?

David
  • 2,101
  • 13
  • 16
  • 25
tyroc
  • 21
  • 1
    Yes, click on its icon in the GUI file manager … Assuming an Ubuntu desktop system. – Raffa Dec 23 '22 at 06:47
  • 1
    @Raffa this sounds like an answer. – user68186 Dec 23 '22 at 07:06
  • You can use the GUI app Disks to format (add the label "Data" during format) as well as mount the partition. – user68186 Dec 23 '22 at 07:08
  • @Raffa Is there any commands to simulate a hotplug event? – tyroc Dec 23 '22 at 07:38
  • What is a "hotpul even"? Should I assume there is coldplug as well? Also, what does it have to do with automount? You can use udisks to mount partions, but I suspect it just calls mount anyway. – mikewhatever Dec 23 '22 at 08:00
  • 2
    You can mount with udisks by partition name e.g. udisksctl mount -b /dev/sdb1 ... but, not without specifying a partition name/identifier AFAIK ... This post might help shed some light on this issue ... It's a bit complicated :-) – Raffa Dec 23 '22 at 08:10
  • Why are you using fdisk all the time. It only should be used to initially partition it or make a change. How is system going to know what changes you made unless you do remount it? You also may have changed label from DATA or have newer partitions that you may or may not want to mount. – oldfred Dec 23 '22 at 16:37

0 Answers0