Difference between revisions of "Parted"
Jump to navigation
Jump to search
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
https://computingforgeeks.com/format-sdcard-usb-flash-drive-on-linux-terminal/ | https://computingforgeeks.com/format-sdcard-usb-flash-drive-on-linux-terminal/ | ||
``` | ``` | ||
+ | lsblk | ||
sudo parted -s /dev/sdb mklabel gpt | sudo parted -s /dev/sdb mklabel gpt | ||
sudo parted -s /dev/sdb mkpart primary ext4 0% 100% | sudo parted -s /dev/sdb mkpart primary ext4 0% 100% | ||
+ | sudo mkfs.ext4 /dev/sdb1 | ||
+ | mkdir usb1 | ||
+ | sudo mount /dev/sdb1 usb1 | ||
+ | echo test >> usb1/test.txt | ||
+ | ls -lhat usb1/ | ||
+ | |||
+ | |||
+ | sudo chown $USER usb1 | ||
+ | |||
+ | |||
+ | sudo mkdir /mnt/usb1 | ||
+ | sudo mount /dev/sdb1 /mnt/usb1/ | ||
+ | echo test | sudo tee -a /mnt/usb1/test.txt | ||
+ | sudo umount /mnt/usb1 | ||
+ | |||
``` | ``` | ||
+ | https://linuxnewbieguide.org/how-to-mount-a-usb-stick-as-a-non-root-user-with-write-permission/ |
Latest revision as of 17:57, 24 June 2023
https://computingforgeeks.com/format-sdcard-usb-flash-drive-on-linux-terminal/
lsblk sudo parted -s /dev/sdb mklabel gpt sudo parted -s /dev/sdb mkpart primary ext4 0% 100% sudo mkfs.ext4 /dev/sdb1 mkdir usb1 sudo mount /dev/sdb1 usb1 echo test >> usb1/test.txt ls -lhat usb1/ sudo chown $USER usb1 sudo mkdir /mnt/usb1 sudo mount /dev/sdb1 /mnt/usb1/ echo test | sudo tee -a /mnt/usb1/test.txt sudo umount /mnt/usb1
https://linuxnewbieguide.org/how-to-mount-a-usb-stick-as-a-non-root-user-with-write-permission/