mount -o rw,<user> /dev/src1 /media/<mount-name> not working
ubuntu
is not a valid mount option. First you need to know the user ID of the user you want to allow read/write access. In the case of a Live session user, it is 999
. The command becomes:
sudo mount -o rw,uid=999 /dev/src1 /mnt
You should not mount a partition on /media
because /media
is reserved for holding multiple mounted devices. Also, consider using the File browser for mounting the partition.
I was assuming that you are using a filesystem that does not support UNIX file permissions, such as FAT32 and NTFS. If you are using a file permissions-aware filesystem, you have to make yourself the owner of the files. Note: dangerous command ahead, so check that you are actually changing the ownership of your USB partition and not your root filesystem:
sudo chown -R ubuntu: /media/your-usb-drive
(note the colon, this causes the group membership to be updated to ubuntu
too)
jp2code
Updated on September 18, 2022Comments
-
jp2code almost 2 years
There are other questions with similar sounding titles, but my case appears to be unique, so here goes:
This problem seems to be centered on using Decimal values in my table. If I create a table and leave out the Precision and Scale parameters, the table creates but all of my data is inserted as an integer value. If I create a table and specify the Precision and Scale parameters, I get the exception thrown below my SQL Statements.
Here is my Create Table statement:
CREATE TABLE RMCoil ( ID int IDENTITY (100,1) PRIMARY KEY , Modified DateTime NOT NULL , [Type] nchar(1) , [Model] nvarchar(50) , [CPPartNo] nvarchar(50) , [FH] decimal(10,10) , [FL] decimal(10,10) , [FPI] int , [TR] nchar(1) , [FinThk] decimal(10,10) , [FinMat] nchar(1) , [TubeOD] int , [Rifled] nchar(1) , [WallThk] decimal(10,10) , [CKT] int , [RD] int , [Split] nvarchar(50) , [CKT1] int , [CKT2] int , [CKT3] int , [CKT4] int , [Feed1] int , [Feed2] int , [Feed3] int , [Feed4] int , [Altitude] decimal(10,10) , [Connection] decimal(10,10) , [Header] decimal(10,10) )
SqlCeCommand.ExecuteNonQuery() returns -1, but this must be OK because it creates the table.
If a table exists, the SELECT statement works fine:
SELECT ID , Modified , [ID] , [MODIFIED] , [Model] , [VoltCode] , [Vendor] , [Product] , [ACRLA208SP] , [LRA208SP] , [ACRLA230SP] , [LRA230SP] , [ACRLA208] , [LRA208] , [ACRLA230] , [LRA230] , [ACRLA380] , [LRA380] , [ACRLA460] , [LRA460] , [ACRLA575] , [LRA575] , [ECRLA208] , [ECRLA230] , [ECRLA460] , [ECRLA575] , [Displacement] , [CF0] , [CF1] , [CF2] , [CF3] , [CF4] , [CF5] , [CF6] , [CF7] , [CF8] , [CF9] , [CF10] , [CF11] , [CF12] , [CF13] , [CF14] , [CF15] , [CF16] , [CF17] , [CF18] , [CF19] , [CF20] , [CF21] , [CF22] , [CF23] , [CF24] , [CF25] , [CF26] , [CF27] , [CF28] , [CF29] , [CF30] , [CF31] , [CF32] , [CF33] , [CF34] , [CF35] , [CF36] , [CF37] , [CF38] , [CF39] FROM RMCompressor
SqlCeCommand.CommandText.Length = 633
INSERT INTO RMCompressor ( Modified , [Model] , [VoltCode] , [Vendor] , [Product] , [ACRLA208SP] , [LRA208SP] , [ACRLA230SP] , [LRA230SP] , [ACRLA208] , [LRA208] , [ACRLA230] , [LRA230] , [ACRLA380] , [LRA380] , [ACRLA460] , [LRA460] , [ACRLA575] , [LRA575] , [ECRLA208] , [ECRLA230] , [ECRLA460] , [ECRLA575] , [Displacement] , [CF0] , [CF1] , [CF2] , [CF3] , [CF4] , [CF5] , [CF6] , [CF7] , [CF8] , [CF9] , [CF10] , [CF11] , [CF12] , [CF13] , [CF14] , [CF15] , [CF16] , [CF17] , [CF18] , [CF19] , [CF20] , [CF21] , [CF22] , [CF23] , [CF24] , [CF25] , [CF26] , [CF27] , [CF28] , [CF29] , [CF30] , [CF31] , [CF32] , [CF33] , [CF34] , [CF35] , [CF36] , [CF37] , [CF38] , [CF39]) VALUES ( GetDate() , @Model , @VoltCode , @Vendor , @Product , @ACRLA208SP , @LRA208SP , @ACRLA230SP , @LRA230SP , @ACRLA208 , @LRA208 , @ACRLA230 , @LRA230 , @ACRLA380 , @LRA380 , @ACRLA460 , @LRA460 , @ACRLA575 , @LRA575 , @ECRLA208 , @ECRLA230 , @ECRLA460 , @ECRLA575 , @Displacement , @CF0 , @CF1 , @CF2 , @CF3 , @CF4 , @CF5 , @CF6 , @CF7 , @CF8 , @CF9 , @CF10 , @CF11 , @CF12 , @CF13 , @CF14 , @CF15 , @CF16 , @CF17 , @CF18 , @CF19 , @CF20 , @CF21 , @CF22 , @CF23 , @CF24 , @CF25 , @CF26 , @CF27 , @CF28 , @CF29 , @CF30 , @CF31 , @CF32 , @CF33 , @CF34 , @CF35 , @CF36 , @CF37 , @CF38 , @CF39 )
SqlCeException:
Expression evaluation caused an overflow. [ Name of function (if known) = ]
HResult:-2147217900
NativeError:25901
Source:SQL Server Compact ADO.NET Data Provider
Does anyone know how to read the HResult or NativeError?
My INSERT statement isn't too long or something, is it?
If it helps, I've uploaded my Visual Studio 2010 C# project SqlCeTool (without the binaries) >> HERE << (I will remove my project link after this issue is resolved).
-
Dour High Arch almost 13 yearsCan you show us the schema of
RMCompressor
and values of@ACRLA208SP
,@LRA380
,@CF0
and such? -
jp2code almost 13 yearsThere is no schema other than what is used to create the table in the
SQL
shown. This application takes anExcel
worksheet and makes an attempt to insert it into anSQL CE
table. The values could be anything. TheRMCompressor.csv
file is in the project linked above (which will eventually be removed). -
Sergey over 12 yearsthere are seem to be typos in your command - what is the "ubuntu" option? Also, /dev/src1 should be /dev/sdc1. Also, usually the mount point is a subdierctory under /media, not the /media directory itself
-
kp9 over 12 yearsubuntu was the default user when I got booted on to ubuntu
-
-
jp2code almost 13 yearsI'm trying to create something generic that can take whatever Engineering has in their
Excel
worksheet and create anSQL
Table out of that. I only have 2 example files to work with, but it looks like their data goes to about 10 digits:{99999999.99 to 9.999999999}
. That's 10 digits, so I coded forPrecision
of10
andScale
of10
. Did I misunderstand the SQL documentation? -
jp2code almost 13 yearsOMG! I think setting the
Precision
to 20 fixed it. Hang on, let me check the actual table. It all inserted fine.... -
jp2code almost 13 yearsYup, that was it! Thanks! BTW: On your profile, your blog website points to a dead link.
-
billinkc almost 13 years@jp2code Much appreciated on the dead link, I get confused on what handle I've used in places ;) I'll update the answer with a BOL reference to scale, precision and length but yeah, the precision is total digits, scale is digits after the decimal.
-
Michael Gundlach over 12 yearsIn the future you can find the
uid
of a user using:id <user>
Where<user>
is the name of the user you wish to find the ID for. -
enzotib over 12 yearsWorth to note that
uid
option is not a general one, but it is valid only for some filesystem types, as for example vfat.