Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have installed an SSD drive in my new Raspberry pi 4 (Argon ONE m.2 box).
I have done it following this instructions: https://thepihut.com/blogs/raspberry...e-raspberry-pi
Everything went fine. But now, I can see the directory of the SSD, but cannot write in it. I don't have permissions. I use "pi" user.
Write button click on the folder says that only owner has permission for changing content.... How can I change this permissions?
Thanks in advance
I have installed an SSD drive in my new Raspberry pi 4 (Argon ONE m.2 box).
I have done it following this instructions: https://thepihut.com/blogs/raspberry...e-raspberry-pi
Everything went fine. But now, I can see the directory of the SSD, but cannot write in it. I don't have permissions. I use "pi" user.
Write button click on the folder says that only owner has permission for changing content.... How can I change this permissions?
Thanks in advance
Does it allow you to open the desktop and run a program like Terminal? If so shows us the output of the ls -l /home/ and the ls -l ~ commands. That will confirm you have changed the permissions correctly. Also does it boot with only the SSD connected? The output of the sudo fisk -l in Terminal would be nice to see too, it will give use idea of the layout of the disk. The mount | grep /dev
Code:
zeus@bullseye-raspi:~$ ls -l /home/
total 4
drwxr-xr-x 9 zeus zeus 4096 Oct 26 10:35 seeder1
zeus@bullseye-raspi:~$ ls -l ~
total 8
drwxr-xr-x 3 zeus zeus 4096 Aug 20 13:23 bin
drwxr-xr-x 13 zeus zeus 4096 Sep 13 19:05 rtorrent
zeus@bullseye-raspi:~$ mount | grep /dev
udev on /dev type devtmpfs (rw,nosuid,relatime,size=3949232k,nr_inodes=987308,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/sda2 on / type ext4 (rw,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
/dev/sda1 on /boot/firmware type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
/dev/sdb1 on /home/seeder1/rtorrent type ext4 (rw,relatime)
root@bullseye-raspi:~# fdisk -l
Disk /dev/sda: 111.79 GiB, 120034123776 bytes, 234441648 sectors
Disk model: ASM105x
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: gpt
Disk identifier: D8A96088-5191-480A-9498-EE006223808B
Device Start End Sectors Size Type
/dev/sda1 40 409639 409600 200M EFI System
/dev/sda2 409640 234441614 234031975 111.6G Linux filesystem
Disk /dev/sdb: 5.46 TiB, 6001175126016 bytes, 11721045168 sectors
Disk model: 2115
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: A961D077-E544-114D-AE7F-37227862FC0B
As you can see from the output of my commands my users is named zeus, everything for his directories is owned by it. The mount shows I have my "/" partition on /dev/sda2 and the firmware partition on the /dev/sda1. The fdisk shows the SSD is partitioned as GPT scheme with the /dev/sda1 marked as a EFI System partition. I also have an additional disk for storage.
Now when I first did my cloning to the SSD I used a tool in the Desktop menu I forget the exact name but it was something about a clone install tool. Look around for that and let it try to do it, it makes exact copy of the files on your card to the SSD and allows it to boot with everything correct. If you cannot get that tool working properly I can give you commands that will duplicate your install without problems it is a simple process that I do on every major upgrade to backup to spare SSD that is used to upgrade the system so I always have working backup copy ready to go in an instant.
Y have done the mkdir command, and now I can see to folders in the file browser with that name. One a simple folder and the other the SSD. Ad I am still not able to write in this.
Could be the problem this? If I right click on the SSD folder in the file browser, and select properties, I can see what follows:
file: niressd
Name: GureSSD
Here is how to do it guaranteed. Boot with the sdcard in the Pi then the following commands use sudo in front of them if you have not enabled the root user. From my notes on installing buster on my SSD copied from the sdcard onto it. These will work with any version of OS except the Windows as I have never tried that build.
Those commands mount the SSD partitions to their copying mount points then do the copy of the files.
Code:
root@rpi4-20201112:/home/seeder1# nano /tmp/ssdroot/etc/fstab
root@rpi4-20201112:/home/seeder1# cat /tmp/ssdroot/etc/fstab
# The root file system has fs_passno=1 as per fstab(5) for automatic fsck.
#LABEL=RASPIROOT / ext4 rw 0 1
PARTUUID=59097f66-f9fb-4a50-a491-8a71becaa2bd / ext4 rw 0 1
# All other file systems have fs_passno=2 as per fstab(5) for automatic fsck.
#LABEL=RASPIFIRM /boot/firmware vfat rw 0 2
PARTUUID=9fad4e77-177d-4a3c-929a-3897e6bc1810 /boot/firmware vfat rw 0 2
# the /proc filesytem
proc /proc proc defaults 0 0
The /etc/fstab edited to boot with the UUID method.
Code:
root@rpi4-20201112:/home/seeder1# nano /tmp/ssdboot/cmdline.txt
root@rpi4-20201112:/home/seeder1# cat /tmp/ssdboot/cmdline.txt
console=tty0 console=ttyS1,115200 root=PARTUUID=59097f66-f9fb-4a50-a491-8a71becaa2bd rw elevator=deadline fsck.repair=yes net.ifnames=0 rootwait
#console=tty0 console=ttyS1,115200 root=LABEL=RASPIROOT rw elevator=deadline fsck.repair=yes net.ifnames=0 rootwait
And success it is I am now booted from ssd.
root@buster-raspi:/home/seeder1# blkid
/dev/sda1: SEC_TYPE="msdos" UUID="3651-174E" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="9fad4e77-177d-4a3c-929a-3897e6bc1810"
/dev/sda2: UUID="4a349c2c-0df5-4fdb-a99f-906423554de9" TYPE="ext4" PARTUUID="59097f66-f9fb-4a50-a491-8a71becaa2bd"
The editing of the cmdline.txt to change to the / UUID for booting and the blkid after the new boot. It is simple procedure to do and works flawlessly every time I use it for my backups or copy install. If wanting to do the LABEL= method to boot from then.
To label the partitions correctly as they were done with the sdcard.
Code:
root@bullseye-raspi:~# cat /etc/fstab
# The root file system has fs_passno=1 as per fstab(5) for automatic fsck.
LABEL=RASPIROOT / ext4 rw 0 1
# All other file systems have fs_passno=2 as per fstab(5) for automatic fsck.
LABEL=RASPIFIRM /boot/firmware vfat rw 0 2
# Added for rtorrent files.
/dev/sdb1 /home/seeder1/rtorrent ext4 defaults 0 2
root@bullseye-raspi:~# cat /boot/firmware/cmdline.txt
console=tty0 console=ttyS1,115200 root=/dev/sda2 rw fsck.repair=yes net.ifnames=0 rootwait
The files as there are currently on my install I left the root=/dev/sda2 in the cmdline.txt as the disk always shows up as the first drive in the system. The LABEL= in the /etc/fstab stops me from having to edit for a new UUID on every backup of my SSD to its spare. Now I check it again you may need to adjust the firmware copying and setting in the /etc/fstab depending where it is mounted in your install on the sdcard. And use the below on the SSD before any copying or label commands used to erase and start with newly formatted partitions.
Code:
mkfs.vfat /dev/sda1
mkfs.ext4 /dev/sda2
Used as root or with sudo in front of the command if using that method. Once done all the steps shutdown the Pi and remove the sdcard and boot into the newly copied install on the SSD.
Here is how to do it guaranteed. Boot with the sdcard in the Pi then the following commands use sudo in front of them if you have not enabled the root user. From my notes on installing buster on my SSD copied from the sdcard onto it. These will work with any version of OS except the Windows as I have never tried that build.
Those commands mount the SSD partitions to their copying mount points then do the copy of the files.
Code:
root@rpi4-20201112:/home/seeder1# nano /tmp/ssdroot/etc/fstab
root@rpi4-20201112:/home/seeder1# cat /tmp/ssdroot/etc/fstab
# The root file system has fs_passno=1 as per fstab(5) for automatic fsck.
#LABEL=RASPIROOT / ext4 rw 0 1
PARTUUID=59097f66-f9fb-4a50-a491-8a71becaa2bd / ext4 rw 0 1
# All other file systems have fs_passno=2 as per fstab(5) for automatic fsck.
#LABEL=RASPIFIRM /boot/firmware vfat rw 0 2
PARTUUID=9fad4e77-177d-4a3c-929a-3897e6bc1810 /boot/firmware vfat rw 0 2
# the /proc filesytem
proc /proc proc defaults 0 0
The /etc/fstab edited to boot with the UUID method.
Code:
root@rpi4-20201112:/home/seeder1# nano /tmp/ssdboot/cmdline.txt
root@rpi4-20201112:/home/seeder1# cat /tmp/ssdboot/cmdline.txt
console=tty0 console=ttyS1,115200 root=PARTUUID=59097f66-f9fb-4a50-a491-8a71becaa2bd rw elevator=deadline fsck.repair=yes net.ifnames=0 rootwait
#console=tty0 console=ttyS1,115200 root=LABEL=RASPIROOT rw elevator=deadline fsck.repair=yes net.ifnames=0 rootwait
And success it is I am now booted from ssd.
root@buster-raspi:/home/seeder1# blkid
/dev/sda1: SEC_TYPE="msdos" UUID="3651-174E" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="9fad4e77-177d-4a3c-929a-3897e6bc1810"
/dev/sda2: UUID="4a349c2c-0df5-4fdb-a99f-906423554de9" TYPE="ext4" PARTUUID="59097f66-f9fb-4a50-a491-8a71becaa2bd"
The editing of the cmdline.txt to change to the / UUID for booting and the blkid after the new boot. It is simple procedure to do and works flawlessly every time I use it for my backups or copy install. If wanting to do the LABEL= method to boot from then.
To label the partitions correctly as they were done with the sdcard.
Code:
root@bullseye-raspi:~# cat /etc/fstab
# The root file system has fs_passno=1 as per fstab(5) for automatic fsck.
LABEL=RASPIROOT / ext4 rw 0 1
# All other file systems have fs_passno=2 as per fstab(5) for automatic fsck.
LABEL=RASPIFIRM /boot/firmware vfat rw 0 2
# Added for rtorrent files.
/dev/sdb1 /home/seeder1/rtorrent ext4 defaults 0 2
root@bullseye-raspi:~# cat /boot/firmware/cmdline.txt
console=tty0 console=ttyS1,115200 root=/dev/sda2 rw fsck.repair=yes net.ifnames=0 rootwait
The files as there are currently on my install I left the root=/dev/sda2 in the cmdline.txt as the disk always shows up as the first drive in the system. The LABEL= in the /etc/fstab stops me from having to edit for a new UUID on every backup of my SSD to its spare. Now I check it again you may need to adjust the firmware copying and setting in the /etc/fstab depending where it is mounted in your install on the sdcard. And use the below on the SSD before any copying or label commands used to erase and start with newly formatted partitions.
Code:
mkfs.vfat /dev/sda1
mkfs.ext4 /dev/sda2
Used as root or with sudo in front of the command if using that method. Once done all the steps shutdown the Pi and remove the sdcard and boot into the newly copied install on the SSD.
pi@raspberrypi:~ $ mount /dev/sda1 /tmp/ssdboot
mount: only root can do that
pi@raspberrypi:~ $
As michaelk has pointed out you forgot the sudo to be doing it using root user permissions. It appears you have a second drive connected to the usb and a rather complicated setup on the sdcard. Can you give us the output of the following command so we can see the layout of how everything is mounted, it can be run with normal user permissions.
Code:
zeus@bullseye-raspi:~$ mount | grep /dev
udev on /dev type devtmpfs (rw,nosuid,relatime,size=3949232k,nr_inodes=987308,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/sda2 on / type ext4 (rw,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
/dev/sda1 on /boot/firmware type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
/dev/sdb1 on /home/seeder1/rtorrent type ext4 (rw,relatime)
What you want to do it try to copy the sdcard to the SSD with the same structure as on it so it will be able to boot properly.
I only want to use SSD as storage. If you recommend me to copy the SD there, I accept your recommendation. The structure of the SD is the original one, I have not done any modification.
Here you have the output of the command:
pi@raspberrypi:~ $ mount | grep /dev
/dev/mmcblk0p7 on / type ext4 (rw,noatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=3879284k,nr_inodes=74939,mode=755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
mqueue on /dev/mqueue type mqueue (rw,relatime)
/dev/sda1 on /home/pi/niressd type ext4 (rw,nosuid,nodev,noexec,relatime,stripe=8191)
/dev/mmcblk0p6 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.